mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-11-04 10:57:10 +08:00 
			
		
		
		
	refactor: 移除 Lombok 私有构造注解使用
修复 Sonarqube 扫描问题
This commit is contained in:
		@@ -16,9 +16,6 @@
 | 
			
		||||
 | 
			
		||||
package top.charles7c.continew.admin.common.config.properties;
 | 
			
		||||
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.extra.spring.SpringUtil;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -28,7 +25,6 @@ import cn.hutool.extra.spring.SpringUtil;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/21 20:21
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class RsaProperties {
 | 
			
		||||
 | 
			
		||||
    /** 私钥 */
 | 
			
		||||
@@ -37,4 +33,7 @@ public class RsaProperties {
 | 
			
		||||
    static {
 | 
			
		||||
        PRIVATE_KEY = SpringUtil.getProperty("rsa.privateKey");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private RsaProperties() {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,8 +16,6 @@
 | 
			
		||||
 | 
			
		||||
package top.charles7c.continew.admin.common.constant;
 | 
			
		||||
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import top.charles7c.continew.starter.core.constant.StringConstants;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -26,9 +24,11 @@ import top.charles7c.continew.starter.core.constant.StringConstants;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/22 19:30
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class CacheConstants {
 | 
			
		||||
 | 
			
		||||
    private CacheConstants() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 分隔符
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -22,15 +22,18 @@ package top.charles7c.continew.admin.common.constant;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2024/1/20 12:33
 | 
			
		||||
 */
 | 
			
		||||
public interface ContainerConstants extends top.charles7c.continew.starter.extension.crud.constant.ContainerConstants {
 | 
			
		||||
public class ContainerConstants implements top.charles7c.continew.starter.extension.crud.constant.ContainerConstants {
 | 
			
		||||
 | 
			
		||||
    private ContainerConstants() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户角色 ID 列表
 | 
			
		||||
     */
 | 
			
		||||
    String USER_ROLE_ID_LIST = "UserRoleIdList";
 | 
			
		||||
    public static final String USER_ROLE_ID_LIST = "UserRoleIdList";
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 角色部门列表
 | 
			
		||||
     */
 | 
			
		||||
    String ROLE_DEPT_ID_LIST = "RoleDeptIdList";
 | 
			
		||||
    public static final String ROLE_DEPT_ID_LIST = "RoleDeptIdList";
 | 
			
		||||
}
 | 
			
		||||
@@ -16,18 +16,17 @@
 | 
			
		||||
 | 
			
		||||
package top.charles7c.continew.admin.common.constant;
 | 
			
		||||
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 文件相关常量
 | 
			
		||||
 *
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2023/1/2 21:19
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class FileConstants {
 | 
			
		||||
 | 
			
		||||
    private FileConstants() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 头像支持的图片类型
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,6 @@
 | 
			
		||||
 | 
			
		||||
package top.charles7c.continew.admin.common.constant;
 | 
			
		||||
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.lang.RegexPool;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -27,9 +24,11 @@ import cn.hutool.core.lang.RegexPool;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2023/1/10 20:06
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class RegexConstants implements RegexPool {
 | 
			
		||||
 | 
			
		||||
    private RegexConstants() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户名正则(长度为 4 到 64 位,可以包含字母、数字,下划线,以字母开头)
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,6 @@
 | 
			
		||||
 | 
			
		||||
package top.charles7c.continew.admin.common.constant;
 | 
			
		||||
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import top.charles7c.continew.starter.core.constant.StringConstants;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -27,9 +24,11 @@ import top.charles7c.continew.starter.core.constant.StringConstants;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2023/2/9 22:11
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class SysConstants {
 | 
			
		||||
 | 
			
		||||
    private SysConstants() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 管理员角色编码
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -16,18 +16,17 @@
 | 
			
		||||
 | 
			
		||||
package top.charles7c.continew.admin.common.constant;
 | 
			
		||||
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * UI 相关常量
 | 
			
		||||
 *
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2023/9/17 14:12
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class UIConstants {
 | 
			
		||||
 | 
			
		||||
    private UIConstants() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主色(极致蓝)
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -16,13 +16,9 @@
 | 
			
		||||
 | 
			
		||||
package top.charles7c.continew.admin.common.util;
 | 
			
		||||
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.codec.Base64;
 | 
			
		||||
import cn.hutool.crypto.SecureUtil;
 | 
			
		||||
import cn.hutool.crypto.asymmetric.KeyType;
 | 
			
		||||
 | 
			
		||||
import top.charles7c.continew.admin.common.config.properties.RsaProperties;
 | 
			
		||||
import top.charles7c.continew.starter.core.util.validate.ValidationUtils;
 | 
			
		||||
 | 
			
		||||
@@ -32,7 +28,6 @@ import top.charles7c.continew.starter.core.util.validate.ValidationUtils;
 | 
			
		||||
 * @author Charles7c
 | 
			
		||||
 * @since 2022/12/21 21:41
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class SecureUtils {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -79,4 +74,7 @@ public class SecureUtils {
 | 
			
		||||
    public static String md5Salt(String data, String salt) {
 | 
			
		||||
        return SecureUtil.md5(SecureUtil.md5(data) + salt);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private SecureUtils() {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -23,8 +23,6 @@ import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import cn.hutool.extra.servlet.JakartaServletUtil;
 | 
			
		||||
import cn.hutool.extra.spring.SpringUtil;
 | 
			
		||||
import jakarta.servlet.http.HttpServletRequest;
 | 
			
		||||
import lombok.AccessLevel;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import top.charles7c.continew.admin.common.constant.CacheConstants;
 | 
			
		||||
import top.charles7c.continew.admin.common.model.dto.LoginUser;
 | 
			
		||||
import top.charles7c.continew.starter.core.util.ExceptionUtils;
 | 
			
		||||
@@ -41,7 +39,6 @@ import java.time.LocalDateTime;
 | 
			
		||||
 * @author Lion Li(<a href="https://gitee.com/dromara/RuoYi-Vue-Plus">RuoYi-Vue-Plus</a>)
 | 
			
		||||
 * @since 2022/12/24 12:58
 | 
			
		||||
 */
 | 
			
		||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
 | 
			
		||||
public class LoginHelper {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -136,4 +133,7 @@ public class LoginHelper {
 | 
			
		||||
    public static String getNickname(Long userId) {
 | 
			
		||||
        return ExceptionUtils.exToNull(() -> SpringUtil.getBean(CommonUserService.class).getNicknameById(userId));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private LoginHelper() {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user