update 统一格式化代码结构

This commit is contained in:
疯狂的狮子li
2021-10-22 10:04:15 +08:00
parent 32bfe334c0
commit 336adbd056
54 changed files with 806 additions and 987 deletions

View File

@ -2,12 +2,10 @@ package com.ruoyi.common.enums;
/**
* 操作状态
*
* @author ruoyi
*
* @author ruoyi
*/
public enum BusinessStatus
{
public enum BusinessStatus {
/**
* 成功
*/

View File

@ -2,11 +2,10 @@ package com.ruoyi.common.enums;
/**
* 业务操作类型
*
*
* @author ruoyi
*/
public enum BusinessType
{
public enum BusinessType {
/**
* 其它
*/
@ -51,7 +50,7 @@ public enum BusinessType
* 生成代码
*/
GENCODE,
/**
* 清空数据
*/

View File

@ -10,16 +10,16 @@ import lombok.Getter;
*/
@AllArgsConstructor
public enum DataSourceType {
/**
* 主库
*/
MASTER("master"),
/**
* 主库
*/
MASTER("master"),
/**
* 从库
*/
SLAVE("slave");
/**
* 从库
*/
SLAVE("slave");
@Getter
private final String source;
@Getter
private final String source;
}

View File

@ -1,36 +1,32 @@
package com.ruoyi.common.enums;
import org.springframework.lang.Nullable;
import java.util.HashMap;
import java.util.Map;
import org.springframework.lang.Nullable;
/**
* 请求方式
*
* @author ruoyi
*/
public enum HttpMethod
{
public enum HttpMethod {
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
static
{
for (HttpMethod httpMethod : values())
{
static {
for (HttpMethod httpMethod : values()) {
mappings.put(httpMethod.name(), httpMethod);
}
}
@Nullable
public static HttpMethod resolve(@Nullable String method)
{
public static HttpMethod resolve(@Nullable String method) {
return (method != null ? mappings.get(method) : null);
}
public boolean matches(String method)
{
public boolean matches(String method) {
return (this == resolve(method));
}
}

View File

@ -6,8 +6,7 @@ package com.ruoyi.common.enums;
* @author ruoyi
*/
public enum LimitType
{
public enum LimitType {
/**
* 默认策略全局限流
*/

View File

@ -2,11 +2,10 @@ package com.ruoyi.common.enums;
/**
* 操作人类别
*
*
* @author ruoyi
*/
public enum OperatorType
{
public enum OperatorType {
/**
* 其它
*/

View File

@ -2,29 +2,25 @@ package com.ruoyi.common.enums;
/**
* 用户状态
*
*
* @author ruoyi
*/
public enum UserStatus
{
public enum UserStatus {
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
private final String code;
private final String info;
UserStatus(String code, String info)
{
UserStatus(String code, String info) {
this.code = code;
this.info = info;
}
public String getCode()
{
public String getCode() {
return code;
}
public String getInfo()
{
public String getInfo() {
return info;
}
}