EnumConstantsMustHaveCommentRule修复

This commit is contained in:
dftre 2025-01-07 11:37:06 +08:00
parent 7a855011ba
commit 7d633941f6
7 changed files with 78 additions and 30 deletions

View File

@ -2,11 +2,17 @@ package com.ruoyi.auth.common.enums;
public enum OauthVerificationUse { public enum OauthVerificationUse {
/** 用于登录 */
LOGIN("登录", "login"), LOGIN("登录", "login"),
/** 用于注册 */
REGISTER("注册", "register"), REGISTER("注册", "register"),
/** 用于禁用 */
DISABLE("禁用", "disable"), DISABLE("禁用", "disable"),
/** 用于重置信息 */
RESET("重置", "reset"), RESET("重置", "reset"),
/** 用于绑定信息 */
BIND("绑定", "bind"), BIND("绑定", "bind"),
/** 其他用途 */
OTHER("其他", "other"); OTHER("其他", "other");
private String name; private String name;

View File

@ -18,8 +18,7 @@ import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface Excel public @interface Excel {
{
/** /**
* 导出时在excel中排序 * 导出时在excel中排序
*/ */
@ -165,34 +164,42 @@ public @interface Excel
*/ */
Type type() default Type.ALL; Type type() default Type.ALL;
public enum Type public enum Type {
{ /** 导出或导入 */
ALL(0), EXPORT(1), IMPORT(2); ALL(0),
/** 仅导出 */
EXPORT(1),
/** 仅导入 */
IMPORT(2);
private final int value; private final int value;
Type(int value) Type(int value) {
{
this.value = value; this.value = value;
} }
public int value() public int value() {
{
return this.value; return this.value;
} }
} }
public enum ColumnType public enum ColumnType {
{ /** 数字 */
NUMERIC(0), STRING(1), IMAGE(2), TEXT(3); NUMERIC(0),
/** 字符串 */
STRING(1),
/** 图片 */
IMAGE(2),
/** 文本 */
TEXT(3);
private final int value; private final int value;
ColumnType(int value) ColumnType(int value) {
{
this.value = value; this.value = value;
} }
public int value() public int value() {
{
return this.value; return this.value;
} }
} }

View File

@ -2,6 +2,7 @@ package com.ruoyi.common.enums;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
/** /**
@ -11,7 +12,22 @@ import org.springframework.lang.Nullable;
*/ */
public enum HttpMethod public enum HttpMethod
{ {
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; /** GET 请求 */
GET,
/** POST 请求 */
HEAD,
/** HEAD 请求 */
POST,
/** PUT 请求 */
PUT,
/** PATCH 请求 */
PATCH,
/** DELETE 请求 */
DELETE,
/** OPTIONS 请求 */
OPTIONS,
/** TRACE 请求 */
TRACE;
private static final Map<String, HttpMethod> mappings = new HashMap<>(16); private static final Map<String, HttpMethod> mappings = new HashMap<>(16);

View File

@ -7,7 +7,12 @@ package com.ruoyi.common.enums;
*/ */
public enum UserStatus public enum UserStatus
{ {
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); /** 正常 */
OK("0", "正常"),
/** 停用 */
DISABLE("1", "停用"),
/** 删除 */
DELETED("2", "删除");
private final String code; private final String code;
private final String info; private final String info;

View File

@ -5,30 +5,36 @@ package com.ruoyi.common.exception.job;
* *
* @author ruoyi * @author ruoyi
*/ */
public class TaskException extends Exception public class TaskException extends Exception {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Code code; private Code code;
public TaskException(String msg, Code code) public TaskException(String msg, Code code) {
{
this(msg, code, null); this(msg, code, null);
} }
public TaskException(String msg, Code code, Exception nestedEx) public TaskException(String msg, Code code, Exception nestedEx) {
{
super(msg, nestedEx); super(msg, nestedEx);
this.code = code; this.code = code;
} }
public Code getCode() public Code getCode() {
{
return code; return code;
} }
public enum Code public enum Code {
{ /** 任务存在 */
TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE TASK_EXISTS,
/** 任务不存在 */
NO_TASK_EXISTS,
/** 任务已经开始 */
TASK_ALREADY_STARTED,
/** 未知 */
UNKNOWN,
/** 配置错误 */
CONFIG_ERROR,
/** 任务节点不可用 */
TASK_NODE_NOT_AVAILABLE
} }
} }

View File

@ -1,8 +1,12 @@
package com.ruoyi.mybatisinterceptor.enums; package com.ruoyi.mybatisinterceptor.enums;
public enum DataSecurityStrategy { public enum DataSecurityStrategy {
/** 通过创建人字段关联表 */
JOINTABLE_CREATE_BY, JOINTABLE_CREATE_BY,
/** 通过用户ID字段关联表 */
JOINTABLE_USER_ID, JOINTABLE_USER_ID,
/** 通过创建人字段 */
CREEATE_BY, CREEATE_BY,
/** 通过用户ID字段 */
USER_ID; USER_ID;
} }

View File

@ -1,9 +1,13 @@
package com.ruoyi.mybatisinterceptor.enums; package com.ruoyi.mybatisinterceptor.enums;
public enum SqlType { public enum SqlType {
/** where */
WHERE("where"), WHERE("where"),
/** join */
JOIN("join"), JOIN("join"),
/** select */
SELECT("select"), SELECT("select"),
/** limit */
LIMIT("limit"); LIMIT("limit");
private String sqlType; private String sqlType;