1.清除日志,月份调整

This commit is contained in:
wr
2024-03-08 16:32:31 +08:00
parent f8766060a6
commit d1124d645b
2 changed files with 6 additions and 1 deletions

View File

@@ -80,6 +80,8 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
private final RedisUtil redisUtil;
private final UserFeignClient userFeignClient;
@Value("${clear.num}")
private Integer clearHistoryLog;
@Override
public Page<AuditLogVO> getAuditLog(AuditParam auditParam) {
List<AuditLogVO> auditLogVOS = new ArrayList<>();
@@ -318,7 +320,7 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
@Override
public void clearHistoryLog() {
LocalDate nowDate = LocalDate.now();
LocalDate agoDate = nowDate.minusMonths(6).with(TemporalAdjusters.firstDayOfMonth());
LocalDate agoDate = nowDate.minusMonths(clearHistoryLog).with(TemporalAdjusters.firstDayOfMonth());
String date = agoDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
QueryWrapper<UserLog> queryWrapper = new QueryWrapper<>();

View File

@@ -59,5 +59,8 @@ runTake:
#等待时间(毫秒)
delayTime: 25000
#清除日志月份
clear:
num: 1
mqtt:
client-id: @artifactId@${random.value}