123
This commit is contained in:
36
ruoyi-admin/src/main/java/com/ruoyi/job/ForbidJob.java
Normal file
36
ruoyi-admin/src/main/java/com/ruoyi/job/ForbidJob.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.ruoyi.job;
|
||||
|
||||
import com.ruoyi.cai.manager.UserForbidManager;
|
||||
import com.ruoyi.cai.service.SysPushService;
|
||||
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;
|
||||
@Autowired
|
||||
private SysPushService sysPushService;
|
||||
|
||||
/**
|
||||
* 每12小时执行一次
|
||||
*/
|
||||
@Scheduled(cron = "0 0 11,23 * * ? ")
|
||||
public void checkForbid(){
|
||||
try {
|
||||
userForbidManager.checkAll();
|
||||
}catch (Exception e){
|
||||
log.error("黑名单失效检测失败!",e);
|
||||
}
|
||||
try {
|
||||
sysPushService.checkAll();
|
||||
}catch (Exception e){
|
||||
log.error("系统推送定时任务检测失败!",e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user