Skip to content

Commit

Permalink
refactor: 移除 Lombok 私有构造注解使用
Browse files Browse the repository at this point in the history
修复 Sonarqube  扫描问题
  • Loading branch information
Charles7c committed Jan 26, 2024
1 parent a154abd commit a2420d3
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package top.charles7c.continew.admin.common.config.properties;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import cn.hutool.extra.spring.SpringUtil;

/**
Expand All @@ -28,7 +25,6 @@
* @author Charles7c
* @since 2022/12/21 20:21
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RsaProperties {

/** 私钥 */
Expand All @@ -37,4 +33,7 @@ public class RsaProperties {
static {
PRIVATE_KEY = SpringUtil.getProperty("rsa.privateKey");
}

private RsaProperties() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -26,9 +24,11 @@
* @author Charles7c
* @since 2022/12/22 19:30
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class CacheConstants {

private CacheConstants() {
}

/**
* 分隔符
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
* @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";
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}

/**
* 头像支持的图片类型
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package top.charles7c.continew.admin.common.constant;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import cn.hutool.core.lang.RegexPool;

/**
Expand All @@ -27,9 +24,11 @@
* @author Charles7c
* @since 2023/1/10 20:06
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RegexConstants implements RegexPool {

private RegexConstants() {
}

/**
* 用户名正则(长度为 4 到 64 位,可以包含字母、数字,下划线,以字母开头)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -27,9 +24,11 @@
* @author Charles7c
* @since 2023/2/9 22:11
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class SysConstants {

private SysConstants() {
}

/**
* 管理员角色编码
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}

/**
* 主色(极致蓝)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -32,7 +28,6 @@
* @author Charles7c
* @since 2022/12/21 21:41
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class SecureUtils {

/**
Expand Down Expand Up @@ -79,4 +74,7 @@ public static String decryptByRsaPrivateKey(String data, String privateKey) {
public static String md5Salt(String data, String salt) {
return SecureUtil.md5(SecureUtil.md5(data) + salt);
}

private SecureUtils() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
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;
Expand All @@ -41,7 +39,6 @@
* @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 {

/**
Expand Down Expand Up @@ -136,4 +133,7 @@ public static String getNickname() {
public static String getNickname(Long userId) {
return ExceptionUtils.exToNull(() -> SpringUtil.getBean(CommonUserService.class).getNicknameById(userId));
}

private LoginHelper() {
}
}

0 comments on commit a2420d3

Please sign in to comment.