Files
zt-closet-backend/pkg/errcode/user_code.go
T
2026-09-11 01:41:52 +08:00

44 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package errcode
// 用户模块错误码段位:20000 - 29999
//
// 细分:
// 20000 - 20999 参数错误
// 21000 - 21999 鉴权 / 登录
// 22000 - 22999 资源不存在
// 23000 - 23999 冲突 / 重复
// 29000 - 29999 服务端错误
// ===== 参数错误(20000 - 20999) =====
var (
UserParamsInvalid = NewError(20000, "用户参数错误")
)
// ===== 鉴权 / 登录(21000 - 21999) =====
var (
UserLoginFailed = NewError(21000, "用户名或密码错误")
UserDisabled = NewError(21001, "账号已被禁用")
UserWxLoginFailed = NewError(21002, "微信登录失败")
UserWxCodeInvalid = NewError(21003, "微信 Code 无效")
UserRegistrationDisabled = NewError(21004, "注册暂未开放")
)
// ===== 资源不存在(22000 - 22999) =====
var (
UserNotFound = NewError(22000, "用户不存在")
)
// ===== 冲突(23000 - 23999) =====
var (
UserAlreadyExists = NewError(23000, "用户已存在")
UserEmailExists = NewError(23001, "邮箱已被注册")
)
// ===== 服务端错误(29000 - 29999) =====
var (
UserCreateFailed = NewError(29000, "用户创建失败")
UserUpdateFailed = NewError(29001, "用户更新失败")
UserDeleteFailed = NewError(29002, "用户删除失败")
UserQueryFailed = NewError(29003, "用户查询失败")
)