mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-05-10 13:52:08 +08:00
update 重构 修改框架内不正常命名与规范是和否的状态
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
package org.dromara.common.core.constant;
|
||||
|
||||
/**
|
||||
* 缓存的key 常量
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface CacheConstants {
|
||||
|
||||
/**
|
||||
* 在线用户 redis key
|
||||
*/
|
||||
String ONLINE_TOKEN_KEY = "online_tokens:";
|
||||
|
||||
/**
|
||||
* 参数管理 cache key
|
||||
*/
|
||||
String SYS_CONFIG_KEY = "sys_config:";
|
||||
|
||||
/**
|
||||
* 字典管理 cache key
|
||||
*/
|
||||
String SYS_DICT_KEY = "sys_dict:";
|
||||
|
||||
/**
|
||||
* 登录账户密码错误次数 redis key
|
||||
*/
|
||||
String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||
|
||||
}
|
||||
@@ -81,4 +81,14 @@ public interface CacheNames {
|
||||
*/
|
||||
String ONLINE_TOKEN = "online_tokens";
|
||||
|
||||
/**
|
||||
* 在线用户 redis key
|
||||
*/
|
||||
String ONLINE_TOKEN_KEY = "online_tokens:";
|
||||
|
||||
/**
|
||||
* 登录账户密码错误次数 redis key
|
||||
*/
|
||||
String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||
|
||||
}
|
||||
|
||||
@@ -22,15 +22,20 @@ public interface SystemConstants {
|
||||
*/
|
||||
String YES = "Y";
|
||||
|
||||
/**
|
||||
* 是否为系统默认(否)
|
||||
*/
|
||||
String NO = "N";
|
||||
|
||||
/**
|
||||
* 是否菜单外链(是)
|
||||
*/
|
||||
String YES_FRAME = "0";
|
||||
String YES_FRAME = YES;
|
||||
|
||||
/**
|
||||
* 是否菜单外链(否)
|
||||
*/
|
||||
String NO_FRAME = "1";
|
||||
String NO_FRAME = NO;
|
||||
|
||||
/**
|
||||
* 菜单类型(目录)
|
||||
|
||||
@@ -7,6 +7,10 @@ import org.dromara.common.core.constant.HttpStatus;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import static org.dromara.common.core.constant.HttpStatus.*;
|
||||
import static org.dromara.common.core.constant.HttpStatus.ERROR;
|
||||
import static org.dromara.common.core.constant.HttpStatus.SUCCESS;
|
||||
|
||||
/**
|
||||
* 响应信息主体
|
||||
*
|
||||
@@ -19,16 +23,6 @@ public class R<T> implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 成功
|
||||
*/
|
||||
public static final int SUCCESS = 200;
|
||||
|
||||
/**
|
||||
* 失败
|
||||
*/
|
||||
public static final int FAIL = 500;
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
@@ -61,19 +55,19 @@ public class R<T> implements Serializable {
|
||||
}
|
||||
|
||||
public static <T> R<T> fail() {
|
||||
return restResult(null, FAIL, "操作失败");
|
||||
return restResult(null, ERROR, "操作失败");
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(String msg) {
|
||||
return restResult(null, FAIL, msg);
|
||||
return restResult(null, ERROR, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(T data) {
|
||||
return restResult(data, FAIL, "操作失败");
|
||||
return restResult(data, ERROR, "操作失败");
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(String msg, T data) {
|
||||
return restResult(data, FAIL, msg);
|
||||
return restResult(data, ERROR, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(int code, String msg) {
|
||||
@@ -87,7 +81,7 @@ public class R<T> implements Serializable {
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static <T> R<T> warn(String msg) {
|
||||
return restResult(null, HttpStatus.WARN, msg);
|
||||
return restResult(null, WARN, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +92,7 @@ public class R<T> implements Serializable {
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static <T> R<T> warn(String msg, T data) {
|
||||
return restResult(data, HttpStatus.WARN, msg);
|
||||
return restResult(data, WARN, msg);
|
||||
}
|
||||
|
||||
private static <T> R<T> restResult(T data, int code, String msg) {
|
||||
@@ -114,7 +108,7 @@ public class R<T> implements Serializable {
|
||||
}
|
||||
|
||||
public static <T> Boolean isSuccess(R<T> ret) {
|
||||
return R.SUCCESS == ret.getCode();
|
||||
return SUCCESS == ret.getCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.lang.annotation.Target;
|
||||
public @interface DictPattern {
|
||||
|
||||
/**
|
||||
* 字典类型,如 "sys_user_sex"
|
||||
* 字典类型,如 "sys_user_gender"
|
||||
*/
|
||||
String dictType();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user