mirror of
				https://github.com/continew-org/continew-starter.git
				synced 2025-10-31 21:02:23 +08:00 
			
		
		
		
	refactor: 移除 Lombok 私有构造注解使用
修复 Sonarqube 扫描问题
This commit is contained in:
		| @@ -23,7 +23,6 @@ import io.swagger.v3.oas.annotations.Operation; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.enums.ParameterIn; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import lombok.NoArgsConstructor; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| @@ -48,7 +47,6 @@ import java.util.List; | ||||
|  * @author Charles7c | ||||
|  * @since 1.0.0 | ||||
|  */ | ||||
| @NoArgsConstructor | ||||
| public abstract class BaseController<S extends BaseService<L, D, Q, C>, L, D, Q, C extends BaseReq> { | ||||
|  | ||||
|     @Autowired | ||||
|   | ||||
| @@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import top.charles7c.continew.starter.extension.crud.constant.ContainerConstants; | ||||
| import top.charles7c.continew.starter.extension.crud.constant.ContainerPool; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.time.LocalDateTime; | ||||
| @@ -45,7 +45,7 @@ public class BaseDetailResp extends BaseResp { | ||||
|      * 修改人 | ||||
|      */ | ||||
|     @JsonIgnore | ||||
|     @Assemble(container = ContainerConstants.USER_NICKNAME, props = @Mapping(ref = "updateUserString")) | ||||
|     @Assemble(container = ContainerPool.USER_NICKNAME, props = @Mapping(ref = "updateUserString")) | ||||
|     private Long updateUser; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; | ||||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import top.charles7c.continew.starter.extension.crud.constant.ContainerConstants; | ||||
| import top.charles7c.continew.starter.extension.crud.constant.ContainerPool; | ||||
|  | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
| @@ -50,7 +50,7 @@ public class BaseResp implements Serializable { | ||||
|      * 创建人 | ||||
|      */ | ||||
|     @JsonIgnore | ||||
|     @Assemble(container = ContainerConstants.USER_NICKNAME, props = @Mapping(ref = "createUserString")) | ||||
|     @Assemble(container = ContainerPool.USER_NICKNAME, props = @Mapping(ref = "createUserString")) | ||||
|     private Long createUser; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -18,7 +18,7 @@ package top.charles7c.continew.starter.extension.crud.base; | ||||
|  | ||||
| import cn.crane4j.annotation.ContainerMethod; | ||||
| import cn.crane4j.annotation.MappingType; | ||||
| import top.charles7c.continew.starter.extension.crud.constant.ContainerConstants; | ||||
| import top.charles7c.continew.starter.extension.crud.constant.ContainerPool; | ||||
|  | ||||
| /** | ||||
|  * 公共用户业务接口 | ||||
| @@ -34,6 +34,6 @@ public interface CommonUserService { | ||||
|      * @param id ID | ||||
|      * @return 昵称 | ||||
|      */ | ||||
|     @ContainerMethod(namespace = ContainerConstants.USER_NICKNAME, type = MappingType.NONE) | ||||
|     @ContainerMethod(namespace = ContainerPool.USER_NICKNAME, type = MappingType.NONE) | ||||
|     String getNicknameById(Long id); | ||||
| } | ||||
|   | ||||
| @@ -22,10 +22,10 @@ package top.charles7c.continew.starter.extension.crud.constant; | ||||
|  * @author Charles7c | ||||
|  * @since 1.2.0 | ||||
|  */ | ||||
| public interface ContainerConstants { | ||||
| public class ContainerPool { | ||||
| 
 | ||||
|     /** | ||||
|      * 用户昵称 | ||||
|      */ | ||||
|     String USER_NICKNAME = "UserNickname"; | ||||
|     public static final String USER_NICKNAME = "UserNickname"; | ||||
| } | ||||
| @@ -24,7 +24,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import jakarta.validation.constraints.Min; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| import org.hibernate.validator.constraints.Range; | ||||
| import org.springdoc.core.annotations.ParameterObject; | ||||
| import org.springframework.data.domain.Sort; | ||||
| @@ -39,7 +38,6 @@ import java.io.Serial; | ||||
|  */ | ||||
| @Data | ||||
| @ParameterObject | ||||
| @NoArgsConstructor | ||||
| @Schema(description = "分页查询条件") | ||||
| public class PageQuery extends SortQuery { | ||||
|  | ||||
| @@ -68,6 +66,9 @@ public class PageQuery extends SortQuery { | ||||
|     @Range(min = 1, max = 1000, message = "每页条数(取值范围 {min}-{max})") | ||||
|     private Integer size = DEFAULT_SIZE; | ||||
|  | ||||
|     public PageQuery() { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 基于分页查询条件转换为 MyBatis Plus 分页条件 | ||||
|      * | ||||
|   | ||||
| @@ -22,8 +22,6 @@ import cn.hutool.core.lang.tree.TreeNodeConfig; | ||||
| import cn.hutool.core.lang.tree.TreeUtil; | ||||
| import cn.hutool.core.lang.tree.parser.NodeParser; | ||||
| import cn.hutool.core.util.ReflectUtil; | ||||
| import lombok.AccessLevel; | ||||
| import lombok.NoArgsConstructor; | ||||
| import top.charles7c.continew.starter.core.util.validate.CheckUtils; | ||||
| import top.charles7c.continew.starter.extension.crud.annotation.TreeField; | ||||
|  | ||||
| @@ -36,9 +34,11 @@ import java.util.List; | ||||
|  * @author Charles7c | ||||
|  * @since 1.0.0 | ||||
|  */ | ||||
| @NoArgsConstructor(access = AccessLevel.PRIVATE) | ||||
| public class TreeUtils { | ||||
|  | ||||
|     private TreeUtils() { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 默认字段配置对象(根据前端树结构灵活调整名称) | ||||
|      */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user