update 优化 编译警告问题 替换过期方法与类
| | |
| | | package org.dromara.common.core.utils; |
| | | |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.dromara.common.core.enums.FormatsType; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| | | public class DateUtils extends org.apache.commons.lang3.time.DateUtils { |
| | | private static final String[] PARSE_PATTERNS = { |
| | | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| | | "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", |
| | | "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"}; |
| | | |
| | | @Deprecated |
| | | private DateUtils() { |
| | | } |
| | | |
| | | /** |
| | | * 获取当前日期和时间 |
| | | * |
| | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.util.AntPathMatcher; |
| | | |
| | | import java.util.*; |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| | | public class StringUtils extends org.apache.commons.lang3.StringUtils { |
| | | |
| | | public static final String SEPARATOR = ","; |
| | | |
| | | public static final String SLASH = "/"; |
| | | |
| | | @Deprecated |
| | | private StringUtils() { |
| | | } |
| | | |
| | | /** |
| | | * 获取参数不为空值 |
| | | * |
| | |
| | | // 设置消耗时间 |
| | | StopWatch stopWatch = KEY_CACHE.get(); |
| | | stopWatch.stop(); |
| | | operLog.setCostTime(stopWatch.getTime()); |
| | | operLog.setCostTime(stopWatch.getDuration().toMillis()); |
| | | // 发布事件保存数据库 |
| | | SpringUtils.context().publishEvent(operLog); |
| | | } catch (Exception exp) { |
| | | // 记录本地异常日志 |
| | | log.error("异常信息:{}", exp.getMessage()); |
| | | exp.printStackTrace(); |
| | | } finally { |
| | | KEY_CACHE.remove(); |
| | | } |
| | |
| | | case "microsoft" -> new AuthMicrosoftRequest(builder.build(), STATE_CACHE); |
| | | case "renren" -> new AuthRenrenRequest(builder.build(), STATE_CACHE); |
| | | case "stack_overflow" -> new AuthStackOverflowRequest(builder.stackOverflowKey(obj.getStackOverflowKey()).build(), STATE_CACHE); |
| | | case "huawei" -> new AuthHuaweiRequest(builder.build(), STATE_CACHE); |
| | | case "huawei" -> new AuthHuaweiV3Request(builder.build(), STATE_CACHE); |
| | | case "wechat_enterprise" -> new AuthWeChatEnterpriseQrcodeRequest(builder.agentId(obj.getAgentId()).build(), STATE_CACHE); |
| | | case "gitlab" -> new AuthGitlabRequest(builder.build(), STATE_CACHE); |
| | | case "wechat_mp" -> new AuthWeChatMpRequest(builder.build(), STATE_CACHE); |
| | |
| | | StopWatch stopWatch = KEY_CACHE.get(); |
| | | if (ObjectUtil.isNotNull(stopWatch)) { |
| | | stopWatch.stop(); |
| | | log.info("[PLUS]结束请求 => URL[{}],耗时:[{}]毫秒", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime()); |
| | | log.info("[PLUS]结束请求 => URL[{}],耗时:[{}]毫秒", request.getMethod() + " " + request.getRequestURI(), stopWatch.getDuration().toMillis()); |
| | | KEY_CACHE.remove(); |
| | | } |
| | | } |