mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 22:57:17 +08:00 
			
		
		
		
	style: 适配 Java 14 新特性
1.增强 switch(Java 12 预览特性 => Java 14 标准特性) 详情请参阅:https://docs.oracle.com/en/java/javase/14/language/switch-expressions.html 2.@Serial(类似于 @Override 的检查注解,用于检查序列化)
This commit is contained in:
		| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.base; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -34,6 +35,7 @@ import com.baomidou.mybatisplus.annotation.TableId; | ||||
| @Data | ||||
| public class BaseDO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.base; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; | ||||
| @Data | ||||
| public class BaseDetailVO extends BaseVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.base; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import jakarta.validation.groups.Default; | ||||
| @@ -31,6 +32,7 @@ import lombok.Data; | ||||
| @Data | ||||
| public class BaseRequest implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.base; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -36,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; | ||||
| @Data | ||||
| public class BaseVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -184,18 +184,11 @@ public class GlobalExceptionHandler { | ||||
|     @ExceptionHandler(NotLoginException.class) | ||||
|     public R handleNotLoginException(NotLoginException e, HttpServletRequest request) { | ||||
|         log.error("请求地址 [{}],认证失败,无法访问系统资源。", request.getRequestURI(), e); | ||||
|         String errorMsg; | ||||
|         switch (e.getType()) { | ||||
|             case NotLoginException.KICK_OUT: | ||||
|                 errorMsg = "您已被踢下线"; | ||||
|                 break; | ||||
|             case NotLoginException.BE_REPLACED_MESSAGE: | ||||
|                 errorMsg = "您已被顶下线"; | ||||
|                 break; | ||||
|             default: | ||||
|                 errorMsg = "登录状态已过期,请重新登录"; | ||||
|                 break; | ||||
|         } | ||||
|         String errorMsg = switch (e.getType()) { | ||||
|             case NotLoginException.KICK_OUT -> "您已被踢下线"; | ||||
|             case NotLoginException.BE_REPLACED_MESSAGE -> "您已被顶下线"; | ||||
|             default -> "登录状态已过期,请重新登录"; | ||||
|         }; | ||||
|         LogContextHolder.setErrorMsg(errorMsg); | ||||
|         return R.fail(HttpStatus.UNAUTHORIZED.value(), errorMsg); | ||||
|     } | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.dto; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -30,6 +31,7 @@ import lombok.Data; | ||||
| @Data | ||||
| public class LogContext implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.dto; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.Set; | ||||
| @@ -35,6 +36,7 @@ import top.charles7c.cnadmin.common.constant.SysConsts; | ||||
| @Data | ||||
| public class LoginUser implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.dto; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -31,6 +32,7 @@ import top.charles7c.cnadmin.common.enums.DataScopeEnum; | ||||
| @Data | ||||
| public class RoleDTO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import jakarta.validation.constraints.Min; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -46,6 +48,7 @@ import cn.hutool.core.util.StrUtil; | ||||
| @Schema(description = "分页查询条件") | ||||
| public class PageQuery extends SortQuery { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| @@ -43,6 +44,7 @@ import top.charles7c.cnadmin.common.constant.StringConsts; | ||||
| @Schema(description = "排序查询条件") | ||||
| public class SortQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| @@ -36,6 +37,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @Schema(description = "修改状态信息") | ||||
| public class UpdateStatusRequest implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "验证码信息") | ||||
| public class CaptchaVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -37,6 +38,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "键值对信息") | ||||
| public class LabelValueVO<V> implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| @@ -43,6 +44,7 @@ import cn.hutool.core.collection.CollUtil; | ||||
| @Schema(description = "分页信息") | ||||
| public class PageDataVO<V> implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.common.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.AccessLevel; | ||||
| @@ -37,6 +38,7 @@ import org.springframework.http.HttpStatus; | ||||
| @Schema(description = "响应信息") | ||||
| public class R<V> implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** 是否成功 */ | ||||
|   | ||||
| @@ -144,57 +144,34 @@ public class QueryHelper { | ||||
|         String columnName = StrUtil.toUnderlineCase(fieldName); | ||||
|         Query.Type queryType = queryAnnotation.type(); | ||||
|         switch (queryType) { | ||||
|             case EQUAL: | ||||
|                 queryWrapper.eq(columnName, fieldValue); | ||||
|                 break; | ||||
|             case NOT_EQUAL: | ||||
|                 queryWrapper.ne(columnName, fieldValue); | ||||
|                 break; | ||||
|             case GREATER_THAN: | ||||
|                 queryWrapper.gt(columnName, fieldValue); | ||||
|                 break; | ||||
|             case LESS_THAN: | ||||
|                 queryWrapper.lt(columnName, fieldValue); | ||||
|                 break; | ||||
|             case GREATER_THAN_OR_EQUAL: | ||||
|                 queryWrapper.ge(columnName, fieldValue); | ||||
|                 break; | ||||
|             case LESS_THAN_OR_EQUAL: | ||||
|                 queryWrapper.le(columnName, fieldValue); | ||||
|                 break; | ||||
|             case BETWEEN: | ||||
|             case EQUAL -> queryWrapper.eq(columnName, fieldValue); | ||||
|             case NOT_EQUAL -> queryWrapper.ne(columnName, fieldValue); | ||||
|             case GREATER_THAN -> queryWrapper.gt(columnName, fieldValue); | ||||
|             case LESS_THAN -> queryWrapper.lt(columnName, fieldValue); | ||||
|             case GREATER_THAN_OR_EQUAL -> queryWrapper.ge(columnName, fieldValue); | ||||
|             case LESS_THAN_OR_EQUAL -> queryWrapper.le(columnName, fieldValue); | ||||
|             case BETWEEN -> { | ||||
|                 List<Object> between = new ArrayList<>((List<Object>)fieldValue); | ||||
|                 if (between.size() >= 2) { | ||||
|                     queryWrapper.between(columnName, between.get(0), between.get(1)); | ||||
|                 } | ||||
|                 break; | ||||
|             case LEFT_LIKE: | ||||
|                 queryWrapper.likeLeft(columnName, fieldValue); | ||||
|                 break; | ||||
|             case INNER_LIKE: | ||||
|                 queryWrapper.like(columnName, fieldValue); | ||||
|                 break; | ||||
|             case RIGHT_LIKE: | ||||
|                 queryWrapper.likeRight(columnName, fieldValue); | ||||
|                 break; | ||||
|             case IN: | ||||
|             } | ||||
|             case LEFT_LIKE -> queryWrapper.likeLeft(columnName, fieldValue); | ||||
|             case INNER_LIKE -> queryWrapper.like(columnName, fieldValue); | ||||
|             case RIGHT_LIKE -> queryWrapper.likeRight(columnName, fieldValue); | ||||
|             case IN -> { | ||||
|                 if (CollUtil.isNotEmpty((List<Object>)fieldValue)) { | ||||
|                     queryWrapper.in(columnName, (List<Object>)fieldValue); | ||||
|                 } | ||||
|                 break; | ||||
|             case NOT_IN: | ||||
|             } | ||||
|             case NOT_IN -> { | ||||
|                 if (CollUtil.isNotEmpty((List<Object>)fieldValue)) { | ||||
|                     queryWrapper.notIn(columnName, (List<Object>)fieldValue); | ||||
|                 } | ||||
|                 break; | ||||
|             case IS_NULL: | ||||
|                 queryWrapper.isNull(columnName); | ||||
|                 break; | ||||
|             case IS_NOT_NULL: | ||||
|                 queryWrapper.isNotNull(columnName); | ||||
|                 break; | ||||
|             default: | ||||
|                 throw new IllegalArgumentException(String.format("暂不支持 [%s] 查询类型", queryType)); | ||||
|             } | ||||
|             case IS_NULL -> queryWrapper.isNull(columnName); | ||||
|             case IS_NOT_NULL -> queryWrapper.isNotNull(columnName); | ||||
|             default -> throw new IllegalArgumentException(String.format("暂不支持 [%s] 查询类型", queryType)); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -36,6 +37,7 @@ import top.charles7c.cnadmin.monitor.enums.LogStatusEnum; | ||||
| @TableName("sys_log") | ||||
| public class LogDO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| @@ -40,6 +41,7 @@ import top.charles7c.cnadmin.common.annotation.Query; | ||||
| @Schema(description = "登录日志查询条件") | ||||
| public class LoginLogQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| @@ -40,6 +41,7 @@ import top.charles7c.cnadmin.common.annotation.Query; | ||||
| @Schema(description = "操作日志查询条件") | ||||
| public class OperationLogQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| @@ -40,6 +41,7 @@ import top.charles7c.cnadmin.common.annotation.Query; | ||||
| @Schema(description = "系统日志查询条件") | ||||
| public class SystemLogQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -34,6 +35,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; | ||||
| @Data | ||||
| public class LogVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @@ -32,6 +34,7 @@ import top.charles7c.cnadmin.monitor.enums.LogStatusEnum; | ||||
| @Schema(description = "登录日志信息") | ||||
| public class LoginLogVO extends LogVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @@ -32,6 +34,7 @@ import top.charles7c.cnadmin.monitor.enums.LogStatusEnum; | ||||
| @Schema(description = "操作日志信息") | ||||
| public class OperationLogVO extends LogVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @@ -30,6 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "系统日志详情信息") | ||||
| public class SystemLogDetailVO extends LogVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.monitor.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @@ -30,6 +32,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "系统日志信息") | ||||
| public class SystemLogVO extends LogVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.auth.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| @@ -38,6 +39,7 @@ import org.springframework.format.annotation.DateTimeFormat; | ||||
| @Schema(description = "在线用户查询条件") | ||||
| public class OnlineUserQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.auth.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| @@ -34,6 +35,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "登录信息") | ||||
| public class LoginRequest implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.auth.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "令牌信息") | ||||
| public class LoginVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.auth.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "元数据信息") | ||||
| public class MetaVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.auth.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -33,6 +34,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "在线用户信息") | ||||
| public class OnlineUserVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.auth.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -38,6 +39,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; | ||||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||||
| public class RouteVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.auth.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDate; | ||||
| import java.time.LocalDateTime; | ||||
| @@ -43,6 +44,7 @@ import top.charles7c.cnadmin.common.enums.GenderEnum; | ||||
| @Schema(description = "用户信息") | ||||
| public class UserInfoVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| @@ -34,6 +36,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @TableName("sys_dept") | ||||
| public class DeptDO extends BaseDO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| @@ -34,6 +36,7 @@ import top.charles7c.cnadmin.common.enums.MenuTypeEnum; | ||||
| @TableName("sys_menu") | ||||
| public class MenuDO extends BaseDO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| @@ -35,6 +37,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @TableName("sys_role") | ||||
| public class RoleDO extends BaseDO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import com.baomidou.mybatisplus.annotation.TableName; | ||||
| @TableName("sys_role_dept") | ||||
| public class RoleDeptDO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import com.baomidou.mybatisplus.annotation.TableName; | ||||
| @TableName("sys_role_menu") | ||||
| public class RoleMenuDO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -37,6 +38,7 @@ import top.charles7c.cnadmin.common.enums.GenderEnum; | ||||
| @TableName("sys_user") | ||||
| public class UserDO extends BaseDO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.entity; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import com.baomidou.mybatisplus.annotation.TableName; | ||||
| @TableName("sys_user_role") | ||||
| public class UserRoleDO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -37,6 +38,7 @@ import top.charles7c.cnadmin.common.annotation.Query; | ||||
| @Schema(description = "部门查询条件") | ||||
| public class DeptQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -37,6 +38,7 @@ import top.charles7c.cnadmin.common.annotation.Query; | ||||
| @Schema(description = "菜单查询条件") | ||||
| public class MenuQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -37,6 +38,7 @@ import top.charles7c.cnadmin.common.annotation.Query; | ||||
| @Schema(description = "角色查询条件") | ||||
| public class RoleQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.query; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| @@ -40,6 +41,7 @@ import top.charles7c.cnadmin.common.annotation.Query; | ||||
| @Schema(description = "用户查询条件") | ||||
| public class UserQuery implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import jakarta.validation.constraints.Pattern; | ||||
| @@ -40,6 +42,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @Schema(description = "创建或修改部门信息") | ||||
| public class DeptRequest extends BaseRequest { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import jakarta.validation.constraints.Pattern; | ||||
| @@ -39,6 +41,7 @@ import top.charles7c.cnadmin.common.enums.MenuTypeEnum; | ||||
| @Schema(description = "创建或修改菜单信息") | ||||
| public class MenuRequest extends BaseRequest { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -44,6 +45,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @Schema(description = "创建或修改角色信息") | ||||
| public class RoleRequest extends BaseRequest { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| @@ -39,6 +40,7 @@ import top.charles7c.cnadmin.common.enums.GenderEnum; | ||||
| @Schema(description = "修改基础信息") | ||||
| public class UpdateBasicInfoRequest implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| @@ -39,6 +40,7 @@ import top.charles7c.cnadmin.common.constant.RegexConsts; | ||||
| @Schema(description = "修改邮箱信息") | ||||
| public class UpdateEmailRequest implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| @@ -34,6 +35,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "修改密码信息") | ||||
| public class UpdatePasswordRequest implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -35,6 +36,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "修改用户角色信息") | ||||
| public class UpdateUserRoleRequest implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.request; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.util.List; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| @@ -44,6 +45,7 @@ import top.charles7c.cnadmin.common.enums.GenderEnum; | ||||
| @Schema(description = "创建或修改用户信息") | ||||
| public class UserRequest extends BaseRequest { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -34,6 +35,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @Schema(description = "头像信息") | ||||
| public class AvatarVO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| @@ -40,6 +42,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @Schema(description = "部门详情信息") | ||||
| public class DeptDetailVO extends BaseDetailVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
| import lombok.experimental.Accessors; | ||||
|  | ||||
| @@ -38,6 +40,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @Schema(description = "部门信息") | ||||
| public class DeptVO extends BaseVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
| import lombok.experimental.Accessors; | ||||
|  | ||||
| @@ -43,6 +45,7 @@ import top.charles7c.cnadmin.common.enums.MenuTypeEnum; | ||||
| @Schema(description = "菜单信息") | ||||
| public class MenuVO extends BaseVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.util.List; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -42,6 +43,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @Schema(description = "角色详情信息") | ||||
| public class RoleDetailVO extends BaseDetailVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| import lombok.Data; | ||||
| import lombok.experimental.Accessors; | ||||
|  | ||||
| @@ -37,6 +39,7 @@ import top.charles7c.cnadmin.common.enums.DisEnableStatusEnum; | ||||
| @Schema(description = "角色信息") | ||||
| public class RoleVO extends BaseVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.List; | ||||
| import java.util.Objects; | ||||
| @@ -45,6 +46,7 @@ import top.charles7c.cnadmin.common.util.helper.LoginHelper; | ||||
| @Schema(description = "用户详情信息") | ||||
| public class UserDetailVO extends BaseDetailVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| package top.charles7c.cnadmin.system.model.vo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.util.Objects; | ||||
|  | ||||
| import lombok.Data; | ||||
| @@ -42,6 +43,7 @@ import top.charles7c.cnadmin.common.util.helper.LoginHelper; | ||||
| @Schema(description = "用户信息") | ||||
| public class UserVO extends BaseVO { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user