This commit is contained in:
张良(004796)
2024-01-19 19:11:18 +08:00
parent 87ed8dbfa7
commit f759a2e45f
6 changed files with 124 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
package com.ruoyi.cai.job;
import com.ruoyi.cai.manager.UserForbidManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class ForbidJob {
@Autowired
private UserForbidManager userForbidManager;
/**
* 每12小时执行一次
*/
@Scheduled(cron = "0 0 11,23 * * ? ")
public void checkForbid(){
try {
userForbidManager.checkAll();
}catch (Exception e){
log.error("黑名单失效检测失败!",e);
}
}
}