refactor: 移除所有的 @Accessors(chain = true),并全局配置禁止使用
This commit is contained in:
parent
2d0e1f42d4
commit
76c65463c2
@ -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 {
|
||||
|
||||
|
@ -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<V> implements Serializable {
|
||||
|
||||
|
@ -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<V> implements Serializable {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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 = "菜单信息")
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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 = "发送验证码到指定邮箱")
|
||||
|
@ -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 = "修改用户基础信息")
|
||||
|
@ -2,4 +2,6 @@ config.stopBubbling=true
|
||||
lombok.toString.callSuper=CALL
|
||||
lombok.equalsAndHashCode.callSuper=CALL
|
||||
clear lombok.val.flagUsage
|
||||
lombok.val.flagUsage=ERROR
|
||||
lombok.val.flagUsage=ERROR
|
||||
clear lombok.accessors.flagUsage
|
||||
lombok.accessors.flagUsage=ERROR
|
Loading…
Reference in New Issue
Block a user