Skip to content

Commit fb44293

Browse files
committed
feat: 添加一个状态码常量类
1 parent 3b30005 commit fb44293

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package top.cadecode.sra.common.consts;
2+
3+
/**
4+
* @author Cade Li
5+
* @date 2022/5/8
6+
* @description Http 状态码
7+
*/
8+
public class HttpStatus {
9+
10+
/**
11+
* 200 OK
12+
*/
13+
public static final int OK = 200;
14+
/**
15+
* 400 错误的请求
16+
*/
17+
public static final int BAD_REQUEST = 400;
18+
/**
19+
* 401 未验证
20+
*/
21+
public static final int NO_AUTHENTICATION = 401;
22+
/**
23+
* 403 被拒绝
24+
*/
25+
public static final int NO_AUTHORITY = 403;
26+
/**
27+
* 404 无法找到
28+
*/
29+
public static final int NOT_FOUND = 404;
30+
/**
31+
* 405 请求方法不合适
32+
*/
33+
public static final int BAD_REQUEST_METHOD = 405;
34+
/**
35+
* 410 已下线
36+
*/
37+
public static final int NOT_SUPPORT = 410;
38+
/**
39+
* 429 过多的请求
40+
*/
41+
public static final int TOO_MANY_REQUESTS = 429;
42+
/**
43+
* 500 内部服务错误
44+
*/
45+
public static final int SERVER_ERROR = 500;
46+
/**
47+
* 502 无效代理
48+
*/
49+
public static final int INVALID_AGENT = 502;
50+
/**
51+
* 503 服务暂时失效
52+
*/
53+
public static final int SERVER_UNAVAILABLE = 503;
54+
/**
55+
* 504 代理超时
56+
*/
57+
public static final int AGENT_TIMEOUT = 504;
58+
}

0 commit comments

Comments
 (0)