【8.1.9】【安全日志】更新异步记录安全日志方法

dev-8.1.9
stylefeng 2024-07-11 18:37:57 +08:00
parent 0cb7bf24c8
commit 71ab4b29b2
1 changed files with 18 additions and 0 deletions

View File

@ -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);
}
});
}
}