style: 应用 Spotless 代码格式化
- 对所有 Java 源文件应用统一的代码格式化 - 统一缩进为 4 个空格 - 清理尾随空白字符和文件末尾换行 - 优化导入语句组织 - 总计格式化 654 个 Java 文件 有问题可以回滚或者找我聊
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
package com.starry.admin.manager;
|
||||
|
||||
|
||||
import com.starry.common.utils.SpringUtils;
|
||||
import com.starry.common.utils.ThreadsUtils;
|
||||
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* 异步任务管理器
|
||||
* @author admin 异步任务管理器
|
||||
* @since 2022/7/25
|
||||
*/
|
||||
public class AsyncManager {
|
||||
@@ -38,7 +35,8 @@ public class AsyncManager {
|
||||
/**
|
||||
* 执行任务
|
||||
*
|
||||
* @param task 任务
|
||||
* @param task
|
||||
* 任务
|
||||
*/
|
||||
public void execute(TimerTask task) {
|
||||
executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.starry.admin.manager;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
/**
|
||||
* 确保应用退出时能关闭后台线程
|
||||
*
|
||||
|
||||
@@ -9,10 +9,9 @@ import com.starry.common.constant.Constants;
|
||||
import com.starry.common.utils.ServletUtils;
|
||||
import com.starry.common.utils.SpringUtils;
|
||||
import com.starry.common.utils.ip.AddressUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.TimerTask;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
@@ -23,13 +22,18 @@ public class AsyncFactory {
|
||||
/**
|
||||
* 记录登录信息
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param status 状态
|
||||
* @param message 消息
|
||||
* @param args 列表
|
||||
* @param username
|
||||
* 用户名
|
||||
* @param status
|
||||
* 状态
|
||||
* @param message
|
||||
* 消息
|
||||
* @param args
|
||||
* 列表
|
||||
* @return 任务task
|
||||
*/
|
||||
public static TimerTask recordLoginLog(final String username, final String status, final String message, final Object... args) {
|
||||
public static TimerTask recordLoginLog(final String username, final String status, final String message,
|
||||
final Object... args) {
|
||||
// 客户端操作系统、浏览器等信息
|
||||
final UserAgent userAgent = UserAgentUtil.parse(ServletUtils.getRequest().getHeader("User-Agent"));
|
||||
// 请求的IP地址
|
||||
@@ -64,4 +68,3 @@ public class AsyncFactory {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user