Skip to content

Commit 08f099d

Browse files
committed
更新错误码
1 parent 070dd4a commit 08f099d

7 files changed

Lines changed: 227 additions & 175 deletions

File tree

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"makefile.configureOnOpen": false
2+
"makefile.configureOnOpen": false,
3+
"python.testing.pytestArgs": [
4+
"test/test_group_user.py"
5+
],
6+
"python.testing.unittestEnabled": false,
7+
"python.testing.pytestEnabled": true
38
}

errorcode/groupuser.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package errorcode
2+
3+
const (
4+
// GroupUserInternalError 一般内部错误
5+
GroupUserInternalError int32 = 1300 + iota
6+
// GroupUserDatabaseError 数据库操作错误
7+
GroupUserDatabaseError
8+
// GroupUserNotFound 群组或用户未找到
9+
GroupUserNotFound
10+
// GroupUserPermissionDenied 权限不足
11+
GroupUserPermissionDenied
12+
// GroupUserAlreadyInGroup 用户已在群组中
13+
GroupUserAlreadyInGroup
14+
// GroupUserPasswordIncorrect 密码不正确
15+
GroupUserPasswordIncorrect
16+
// GroupUserQueryError 用户查询错误
17+
GroupUserQueryError
18+
// GroupUserInsertError 插入操作错误
19+
GroupUserInsertError
20+
)

errorcode/public.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package errorcode
2+
3+
// 8xx 成功
4+
const (
5+
// Success 成功处理请求
6+
Success int32 = 800 + iota
7+
)
8+
9+
// 9xx 通用错误
10+
const (
11+
// ServerFailed 服务器未捕获异常
12+
ServerFailed int32 = 900 + iota
13+
// ServerRefused 服务器未能成功处理请求
14+
ServerRefused
15+
// ServerInternalComponentError 服务器运行时错误
16+
ServerInternalComponentError
17+
// ServerInternalNetworkError 服务器组件通信错误
18+
ServerInternalNetworkError
19+
// ServerOverload 服务器过载
20+
ServerOverload
21+
// ServerLimited 请求过大
22+
ServerLimited
23+
// ServerError 其它问题
24+
ServerError
25+
)

0 commit comments

Comments
 (0)