diff --git a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/CaptchaVO.java b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/CaptchaVO.java index 7b80583c..a9478f39 100644 --- a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/CaptchaVO.java +++ b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/CaptchaVO.java @@ -18,8 +18,8 @@ package top.charles7c.cnadmin.common.model.vo; import java.io.Serializable; +import lombok.Builder; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema; * @since 2022/12/11 13:55 */ @Data -@Accessors(chain = true) +@Builder @Schema(description = "验证码信息") public class CaptchaVO implements Serializable { diff --git a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/LabelValueVO.java b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/LabelValueVO.java index e47ef5fb..92504f03 100644 --- a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/LabelValueVO.java +++ b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/LabelValueVO.java @@ -20,7 +20,6 @@ import java.io.Serializable; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -33,7 +32,6 @@ import io.swagger.v3.oas.annotations.media.Schema; */ @Data @NoArgsConstructor -@Accessors(chain = true) @Schema(description = "键值对信息") public class LabelValueVO implements Serializable { diff --git a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/PageDataVO.java b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/PageDataVO.java index 4e012277..06949855 100644 --- a/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/PageDataVO.java +++ b/continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/PageDataVO.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.List; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -39,7 +38,6 @@ import cn.hutool.core.collection.CollUtil; * @since 2023/1/14 23:40 */ @Data -@Accessors(chain = true) @Schema(description = "分页信息") public class PageDataVO implements Serializable { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/LoginVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/LoginVO.java index 08903d8b..42c523e9 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/LoginVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/LoginVO.java @@ -18,8 +18,8 @@ package top.charles7c.cnadmin.auth.model.vo; import java.io.Serializable; +import lombok.Builder; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema; * @since 2022/12/21 20:42 */ @Data -@Accessors(chain = true) +@Builder @Schema(description = "令牌信息") public class LoginVO implements Serializable { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/MetaVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/MetaVO.java index 28ff02b2..106527a8 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/MetaVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/MetaVO.java @@ -19,7 +19,6 @@ package top.charles7c.cnadmin.auth.model.vo; import java.io.Serializable; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -30,7 +29,6 @@ import io.swagger.v3.oas.annotations.media.Schema; * @since 2023/2/26 22:51 */ @Data -@Accessors(chain = true) @Schema(description = "元数据信息") public class MetaVO implements Serializable { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/RouteVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/RouteVO.java index cc7a90f0..7d05c433 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/RouteVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/RouteVO.java @@ -20,7 +20,6 @@ import java.io.Serializable; import java.util.List; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -33,7 +32,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; * @since 2023/2/26 22:51 */ @Data -@Accessors(chain = true) @Schema(description = "路由信息") @JsonInclude(JsonInclude.Include.NON_EMPTY) public class RouteVO implements Serializable { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/UserInfoVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/UserInfoVO.java index 8b718bc1..f6e1b289 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/UserInfoVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/UserInfoVO.java @@ -22,7 +22,6 @@ import java.time.LocalDateTime; import java.util.Set; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -39,7 +38,6 @@ import top.charles7c.cnadmin.common.enums.GenderEnum; * @since 2022/12/29 20:15 */ @Data -@Accessors(chain = true) @Schema(description = "用户信息") public class UserInfoVO implements Serializable { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/AvatarVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/AvatarVO.java index bd3a9abc..68bde236 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/AvatarVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/AvatarVO.java @@ -18,8 +18,8 @@ package top.charles7c.cnadmin.system.model.vo; import java.io.Serializable; +import lombok.Builder; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.media.Schema; * @since 2023/1/2 16:29 */ @Data -@Accessors(chain = true) +@Builder @Schema(description = "头像信息") public class AvatarVO implements Serializable { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/DeptVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/DeptVO.java index c712c233..ca36e469 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/DeptVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/DeptVO.java @@ -17,7 +17,6 @@ package top.charles7c.cnadmin.system.model.vo; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -33,7 +32,6 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; * @since 2023/1/22 13:53 */ @Data -@Accessors(chain = true) @TreeField(value = "id", nameKey = "name") @Schema(description = "部门信息") public class DeptVO extends BaseVO { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/MenuVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/MenuVO.java index 693d94c8..bbcaf1e9 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/MenuVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/MenuVO.java @@ -17,7 +17,6 @@ package top.charles7c.cnadmin.system.model.vo; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -37,7 +36,6 @@ import top.charles7c.cnadmin.common.enums.MenuTypeEnum; * @since 2023/2/15 20:23 */ @Data -@Accessors(chain = true) @TreeField(value = "id") @ExcelIgnoreUnannotated @Schema(description = "菜单信息") diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/RoleVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/RoleVO.java index b39a1a92..341b42df 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/RoleVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/RoleVO.java @@ -17,7 +17,6 @@ package top.charles7c.cnadmin.system.model.vo; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -33,7 +32,6 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; * @since 2023/2/8 23:05 */ @Data -@Accessors(chain = true) @Schema(description = "角色信息") public class RoleVO extends BaseVO { diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserVO.java index faad073b..12e9f456 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserVO.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/vo/UserVO.java @@ -19,7 +19,6 @@ package top.charles7c.cnadmin.system.model.vo; import java.util.Objects; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -38,7 +37,6 @@ import top.charles7c.cnadmin.common.util.helper.LoginHelper; * @since 2023/2/20 21:08 */ @Data -@Accessors(chain = true) @Schema(description = "用户信息") public class UserVO extends BaseVO { diff --git a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/FieldConfigDO.java b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/FieldConfigDO.java index 6fa37dc5..e4615d8f 100644 --- a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/FieldConfigDO.java +++ b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/FieldConfigDO.java @@ -24,7 +24,6 @@ import javax.validation.constraints.NotBlank; import lombok.Data; import lombok.NoArgsConstructor; import lombok.NonNull; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -48,9 +47,8 @@ import top.charles7c.cnadmin.tool.enums.FormTypeEnum; * @since 2023/4/12 20:21 */ @Data -@TableName("gen_field_config") @NoArgsConstructor -@Accessors(chain = true) +@TableName("gen_field_config") @Schema(description = "字段配置信息") public class FieldConfigDO implements Serializable { @@ -144,22 +142,25 @@ public class FieldConfigDO implements Serializable { String columnType = StrUtil.splitToArray(column.getTypeName(), StringConsts.SPACE)[0].toLowerCase(); boolean isRequired = !column.isPk() && !column.isNullable(); this.tableName = column.getTableName(); - this.setColumnName(column.getName()).setColumnType(columnType).setComment(column.getComment()) - .setIsRequired(isRequired).setShowInList(true).setShowInForm(isRequired).setShowInQuery(isRequired) - .setFormType(FormTypeEnum.TEXT); + this.setColumnName(column.getName()); + this.setColumnType(columnType); + this.setComment(column.getComment()); + this.setIsRequired(isRequired); + this.setShowInList(true); + this.setShowInForm(isRequired); + this.setShowInQuery(isRequired); + this.setFormType(FormTypeEnum.TEXT); this.setQueryType("String".equals(this.getFieldType()) ? QueryTypeEnum.INNER_LIKE : QueryTypeEnum.EQUAL); } - public FieldConfigDO setColumnName(String columnName) { + public void setColumnName(String columnName) { this.columnName = columnName; this.fieldName = StrUtil.toCamelCase(this.columnName); - return this; } - public FieldConfigDO setColumnType(String columnType) { + public void setColumnType(String columnType) { this.columnType = columnType; Props generatorProp = PropsUtil.get("generator"); this.fieldType = generatorProp.getStr(columnType); - return this; } } diff --git a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/GenConfigDO.java b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/GenConfigDO.java index 96a6261b..163662fe 100644 --- a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/GenConfigDO.java +++ b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/GenConfigDO.java @@ -25,7 +25,6 @@ import javax.validation.constraints.Pattern; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -42,9 +41,8 @@ import top.charles7c.cnadmin.common.constant.RegexConsts; * @since 2023/4/12 20:21 */ @Data -@TableName("gen_config") @NoArgsConstructor -@Accessors(chain = true) +@TableName("gen_config") @Schema(description = "生成配置信息") public class GenConfigDO implements Serializable { diff --git a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/vo/TableVO.java b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/vo/TableVO.java index 01302930..08110b00 100644 --- a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/vo/TableVO.java +++ b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/vo/TableVO.java @@ -20,7 +20,6 @@ import java.io.Serializable; import java.time.LocalDateTime; import lombok.Data; -import lombok.experimental.Accessors; import io.swagger.v3.oas.annotations.media.Schema; @@ -31,7 +30,6 @@ import io.swagger.v3.oas.annotations.media.Schema; * @since 2023/4/12 20:21 */ @Data -@Accessors(chain = true) @Schema(description = "表信息") public class TableVO implements Serializable { diff --git a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/service/impl/GeneratorServiceImpl.java b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/service/impl/GeneratorServiceImpl.java index 7dacb541..09f8be58 100644 --- a/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/service/impl/GeneratorServiceImpl.java +++ b/continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/service/impl/GeneratorServiceImpl.java @@ -134,7 +134,8 @@ public class GeneratorServiceImpl implements GeneratorService { if (null != fieldConfig) { // 更新已有字段配置 String columnType = StrUtil.splitToArray(column.getTypeName(), StringConsts.SPACE)[0].toLowerCase(); - fieldConfig.setColumnType(columnType).setComment(column.getComment()); + fieldConfig.setColumnType(columnType); + fieldConfig.setComment(column.getComment()); } else { // 新增字段配置 fieldConfig = new FieldConfigDO(column); diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/LoginController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/LoginController.java index 70687e58..dde4b9e3 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/LoginController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/LoginController.java @@ -79,7 +79,7 @@ public class LoginController { ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(loginRequest.getPassword())); ValidationUtils.throwIfBlank(rawPassword, "密码解密失败"); String token = loginService.login(loginRequest.getUsername(), rawPassword); - return R.ok(new LoginVO().setToken(token)); + return R.ok(LoginVO.builder().token(token).build()); } @SaIgnore diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CaptchaController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CaptchaController.java index d0f1a133..00915893 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CaptchaController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/common/CaptchaController.java @@ -79,10 +79,7 @@ public class CaptchaController { String captchaKey = RedisUtils.formatKey(CacheConsts.CAPTCHA_KEY_PREFIX, uuid); RedisUtils.setCacheObject(captchaKey, captcha.text(), Duration.ofMinutes(captchaImage.getExpirationInMinutes())); - - // 返回验证码 - CaptchaVO captchaVO = new CaptchaVO().setUuid(uuid).setImg(captcha.toBase64()); - return R.ok(captchaVO); + return R.ok(CaptchaVO.builder().uuid(uuid).img(captcha.toBase64()).build()); } @Operation(summary = "获取邮箱验证码", description = "发送验证码到指定邮箱") diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java index 5f89500c..38cbb9ec 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java @@ -65,7 +65,7 @@ public class UserCenterController { // 上传头像 String newAvatar = userService.uploadAvatar(avatarFile, LoginHelper.getUserId()); - return R.ok("上传成功", new AvatarVO().setAvatar(newAvatar)); + return R.ok("上传成功", AvatarVO.builder().avatar(newAvatar).build()); } @Operation(summary = "修改基础信息", description = "修改用户基础信息") diff --git a/lombok.config b/lombok.config index 72e13d5a..1135ca1d 100644 --- a/lombok.config +++ b/lombok.config @@ -2,4 +2,6 @@ config.stopBubbling=true lombok.toString.callSuper=CALL lombok.equalsAndHashCode.callSuper=CALL clear lombok.val.flagUsage -lombok.val.flagUsage=ERROR \ No newline at end of file +lombok.val.flagUsage=ERROR +clear lombok.accessors.flagUsage +lombok.accessors.flagUsage=ERROR \ No newline at end of file