diff --git a/kernel-d-log/log-api/src/main/java/cn/stylefeng/roses/kernel/log/api/schedule/AsyncLogManager.java b/kernel-d-log/log-api/src/main/java/cn/stylefeng/roses/kernel/log/api/schedule/AsyncLogManager.java index 68953c419..94094bbcd 100644 --- a/kernel-d-log/log-api/src/main/java/cn/stylefeng/roses/kernel/log/api/schedule/AsyncLogManager.java +++ b/kernel-d-log/log-api/src/main/java/cn/stylefeng/roses/kernel/log/api/schedule/AsyncLogManager.java @@ -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); + } + }); + } + }