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