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

@@ -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));
}
}