This commit is contained in:
2026-08-14 12:20:52 +08:00
parent ce0812211c
commit afd7c9d704
17 changed files with 1641 additions and 0 deletions
@@ -0,0 +1,25 @@
package com.yunhai.bschclassmanage.scheduler;
import com.yunhai.bschclassmanage.service.ISysOperationLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class SysOperationLogCleanupTask {
@Autowired
private ISysOperationLogService sysOperationLogService;
@Scheduled(cron = "0 30 3 * * ?") // 每日 03:30(与业务零点任务错峰)
public void run() {
try {
long deleted = sysOperationLogService.cleanupExpired();
log.info("审计日志定时清理完成, 删除{}条", deleted);
} catch (Exception e) {
log.error("审计日志定时清理失败", e);
}
}
}