Skip to content

Commit a3b3019

Browse files
committed
添加StatusConflict
1 parent 4efb003 commit a3b3019

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

exception/code.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const (
2424
Forbidden = http.StatusForbidden
2525
// NotFound 接口未找到
2626
NotFound = http.StatusNotFound
27+
// Conflict 资源冲突, 已经存在
28+
Conflict = http.StatusConflict
2729

2830
// UnKnownException 未知异常
2931
UnKnownException = 99999
@@ -33,6 +35,7 @@ var (
3335
reasonMap = map[int]string{
3436
Unauthorized: "认证失败",
3537
NotFound: "资源未找到",
38+
Conflict: "资源已经存在",
3639
BadRequest: "请求不合法",
3740
InternalServerError: "系统内部错误",
3841
Forbidden: "访问未授权",

0 commit comments

Comments
 (0)