mirror of https://gitee.com/stylefeng/roses
【8.1.9】【安全日志】更新异步记录安全日志方法
parent
0cb7bf24c8
commit
71ab4b29b2
|
@ -2,6 +2,8 @@ package cn.stylefeng.roses.kernel.log.api.schedule;
|
|||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.stylefeng.roses.kernel.log.api.LoginLogServiceApi;
|
||||
import cn.stylefeng.roses.kernel.log.api.SecurityLogServiceApi;
|
||||
import cn.stylefeng.roses.kernel.log.api.pojo.security.LogSecurityRequest;
|
||||
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
|
@ -55,4 +57,20 @@ public class AsyncLogManager {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步记录安全日志
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/7/11 18:36
|
||||
*/
|
||||
public void recordSecurityLog(LogSecurityRequest logSecurityRequest) {
|
||||
this.executeLog(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
SecurityLogServiceApi securityLogServiceApi = SpringUtil.getBean(SecurityLogServiceApi.class);
|
||||
securityLogServiceApi.add(logSecurityRequest);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue