mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化 编译警告问题 替换过期方法与类
This commit is contained in:
		@@ -1,7 +1,5 @@
 | 
			
		||||
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;
 | 
			
		||||
@@ -18,13 +16,16 @@ import java.util.concurrent.TimeUnit;
 | 
			
		||||
 *
 | 
			
		||||
 * @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() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取当前日期和时间
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -4,8 +4,6 @@ import cn.hutool.core.collection.CollUtil;
 | 
			
		||||
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.*;
 | 
			
		||||
@@ -17,13 +15,16 @@ import java.util.stream.Collectors;
 | 
			
		||||
 *
 | 
			
		||||
 * @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() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取参数不为空值
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -113,13 +113,12 @@ public class LogAspect {
 | 
			
		||||
            // 设置消耗时间
 | 
			
		||||
            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();
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ public class SocialUtils  {
 | 
			
		||||
            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);
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@ public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
 | 
			
		||||
        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();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user