mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-11-04 10:57:10 +08:00 
			
		
		
		
	refactor: 优化接口文档枚举参数显示效果
This commit is contained in:
		@@ -63,7 +63,7 @@ public class UserInfoResp implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 性别
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "性别(0:未知;1:男;2:女)", type = "Integer", allowableValues = {"0", "1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "性别", example = "1")
 | 
			
		||||
    private GenderEnum gender;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -65,6 +65,11 @@ public enum FileTypeEnum implements IBaseEnum<Integer> {
 | 
			
		||||
    private final String description;
 | 
			
		||||
    private final List<String> extensions;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "%s: %s".formatted(this.value, this.description);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据扩展名查询
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,11 @@ public enum ImportPolicyEnum implements IBaseEnum<Integer> {
 | 
			
		||||
    private final Integer value;
 | 
			
		||||
    private final String description;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "%s: %s".formatted(this.value, this.description);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean validate(ImportPolicyEnum importPolicy, String data, List<String> existList) {
 | 
			
		||||
        return this == importPolicy && CollUtil.isNotEmpty(existList) && existList.contains(data);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -42,4 +42,9 @@ public enum LogStatusEnum implements IBaseEnum<Integer> {
 | 
			
		||||
 | 
			
		||||
    private final Integer value;
 | 
			
		||||
    private final String description;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "%s: %s".formatted(this.value, this.description);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -52,6 +52,11 @@ public enum NoticeStatusEnum implements IBaseEnum<Integer> {
 | 
			
		||||
    private final String description;
 | 
			
		||||
    private final String color;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "%s: %s".formatted(this.value, this.description);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取公告状态
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -42,4 +42,9 @@ public enum StorageTypeEnum implements IBaseEnum<Integer> {
 | 
			
		||||
 | 
			
		||||
    private final Integer value;
 | 
			
		||||
    private final String description;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "%s: %s".formatted(this.value, this.description);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ public class DeptReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,7 @@ public class DictItemReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ public class MenuReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 类型
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "类型(1:目录;2:菜单;3:按钮)", type = "Integer", allowableValues = {"1", "2", "3"}, example = "2")
 | 
			
		||||
    @Schema(description = "类型", example = "2")
 | 
			
		||||
    @NotNull(message = "类型非法")
 | 
			
		||||
    private MenuTypeEnum type;
 | 
			
		||||
 | 
			
		||||
@@ -132,7 +132,7 @@ public class MenuReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    @NotNull(message = "状态非法")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -82,8 +82,7 @@ public class RoleReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 数据权限
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "数据权限(1:全部数据权限;2:本部门及以下数据权限;3:本部门数据权限;4:仅本人数据权限;5:自定义数据权限)", type = "Integer", allowableValues = {
 | 
			
		||||
        "1", "2", "3", "4", "5"}, example = "5")
 | 
			
		||||
    @Schema(description = "数据权限", example = "5")
 | 
			
		||||
    private DataScopeEnum dataScope;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,7 @@ public class StorageReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 类型
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "类型", type = "Integer", allowableValues = {"1", "2"}, example = "2")
 | 
			
		||||
    @Schema(description = "类型", example = "2")
 | 
			
		||||
    @NotNull(message = "类型非法")
 | 
			
		||||
    private StorageTypeEnum type;
 | 
			
		||||
 | 
			
		||||
@@ -129,6 +129,6 @@ public class StorageReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
}
 | 
			
		||||
@@ -51,7 +51,7 @@ public class UserBasicInfoUpdateReq implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 性别
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "性别(0:未知;1:男;2:女)", type = "Integer", allowableValues = {"0", "1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "性别", example = "1")
 | 
			
		||||
    @NotNull(message = "性别非法")
 | 
			
		||||
    private GenderEnum gender;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -49,27 +49,27 @@ public class UserImportReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户重复策略
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "重复用户策略", type = "Integer", allowableValues = {"1", "2", "3", "4"}, example = "1")
 | 
			
		||||
    @Schema(description = "重复用户策略", example = "1")
 | 
			
		||||
    @NotNull(message = "重复用户策略不能为空")
 | 
			
		||||
    private ImportPolicyEnum duplicateUser;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 重复邮箱策略
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "重复邮箱策略", type = "Integer", allowableValues = {"1", "2", "3", "4"}, example = "1")
 | 
			
		||||
    @Schema(description = "重复邮箱策略", example = "1")
 | 
			
		||||
    @NotNull(message = "重复邮箱策略不能为空")
 | 
			
		||||
    private ImportPolicyEnum duplicateEmail;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 重复手机策略
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "重复手机策略", type = "Integer", allowableValues = {"1", "2", "3", "4"}, example = "1")
 | 
			
		||||
    @Schema(description = "重复手机策略", example = "1")
 | 
			
		||||
    @NotNull(message = "重复手机策略不能为空")
 | 
			
		||||
    private ImportPolicyEnum duplicatePhone;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 默认状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "默认状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "默认状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum defaultStatus;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,7 @@ public class UserReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 性别
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "性别(0:未知;1:男;2:女)", type = "Integer", allowableValues = {"0", "1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "性别", example = "1")
 | 
			
		||||
    @NotNull(message = "性别非法")
 | 
			
		||||
    private GenderEnum gender;
 | 
			
		||||
 | 
			
		||||
@@ -115,6 +115,6 @@ public class UserReq extends BaseReq {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ public class DeptResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    @ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class, order = 5)
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ public class DictItemResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    @ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class)
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -65,8 +65,7 @@ public class FileResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 类型
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "类型(1:其他;2:图片;3:文档;4:视频;5:音频)", type = "Integer", allowableValues = {"1", "2", "3", "4",
 | 
			
		||||
        "5"}, example = "2")
 | 
			
		||||
    @Schema(description = "类型", example = "2")
 | 
			
		||||
    private FileTypeEnum type;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -42,8 +42,7 @@ public class FileStatisticsResp implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 文件类型
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "类型(1:其他;2:图片;3:文档;4:视频;5:音频)", type = "Integer", allowableValues = {"1", "2", "3", "4",
 | 
			
		||||
        "5"}, example = "2")
 | 
			
		||||
    @Schema(description = "类型", example = "2")
 | 
			
		||||
    private FileTypeEnum type;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -54,7 +54,7 @@ public class MenuResp extends BaseResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 类型
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "类型(1:目录;2:菜单;3:按钮)", type = "Integer", allowableValues = {"1", "2", "3"}, example = "2")
 | 
			
		||||
    @Schema(description = "类型", example = "2")
 | 
			
		||||
    private MenuTypeEnum type;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -120,6 +120,6 @@ public class MenuResp extends BaseResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@ public class NoticeResp extends BaseResp {
 | 
			
		||||
     *
 | 
			
		||||
     * @return 公告状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:待发布;2:已发布;3:已过期)", type = "Integer", allowableValues = {"1", "2", "3"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    public NoticeStatusEnum getStatus() {
 | 
			
		||||
        return NoticeStatusEnum.getStatus(effectiveTime, terminateTime);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -63,8 +63,7 @@ public class RoleDetailResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 数据权限
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "数据权限(1:全部数据权限;2:本部门及以下数据权限;3:本部门数据权限;4:仅本人数据权限;5:自定义数据权限)", type = "Integer", allowableValues = {
 | 
			
		||||
        "1", "2", "3", "4", "5"}, example = "5")
 | 
			
		||||
    @Schema(description = "数据权限", example = "5")
 | 
			
		||||
    @ExcelProperty(value = "数据权限", converter = ExcelBaseEnumConverter.class)
 | 
			
		||||
    private DataScopeEnum dataScope;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -51,8 +51,7 @@ public class RoleResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 数据权限
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "数据权限(1:全部数据权限;2:本部门及以下数据权限;3:本部门数据权限;4:仅本人数据权限;5:自定义数据权限)", type = "Integer", allowableValues = {
 | 
			
		||||
        "1", "2", "3", "4", "5"}, example = "5")
 | 
			
		||||
    @Schema(description = "数据权限", example = "5")
 | 
			
		||||
    private DataScopeEnum dataScope;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -53,13 +53,13 @@ public class StorageResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 类型
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "类型(1:兼容S3协议存储;2:本地存储)", type = "Integer", allowableValues = {"1", "2"}, example = "2")
 | 
			
		||||
    @Schema(description = "类型", example = "2")
 | 
			
		||||
    private StorageTypeEnum type;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -73,14 +73,14 @@ public class UserDetailResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    @ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class, order = 4)
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 性别
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "性别(0:未知;1:男;2:女)", type = "Integer", allowableValues = {"0", "1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "性别", example = "1")
 | 
			
		||||
    @ExcelProperty(value = "性别", converter = ExcelBaseEnumConverter.class, order = 5)
 | 
			
		||||
    private GenderEnum gender;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ public class UserResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 性别
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "性别(0:未知;1:男;2:女)", type = "Integer", allowableValues = {"0", "1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "性别", example = "1")
 | 
			
		||||
    private GenderEnum gender;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -87,7 +87,7 @@ public class UserResp extends BaseDetailResp {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:启用;2:禁用)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private DisEnableStatusEnum status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -140,7 +140,7 @@ public class LogDetailResp implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:成功;2:失败)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private LogStatusEnum status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,7 @@ public class LogResp implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:成功;2:失败)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    private LogStatusEnum status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ public class LoginLogExportResp implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:成功;2:失败)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    @ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class)
 | 
			
		||||
    private LogStatusEnum status;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ public class OperationLogExportResp implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 状态
 | 
			
		||||
     */
 | 
			
		||||
    @Schema(description = "状态(1:成功;2:失败)", type = "Integer", allowableValues = {"1", "2"}, example = "1")
 | 
			
		||||
    @Schema(description = "状态", example = "1")
 | 
			
		||||
    @ExcelProperty(value = "状态", converter = ExcelBaseEnumConverter.class)
 | 
			
		||||
    private LogStatusEnum status;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user