Files
zt-online-game-backend/pkg/errcode/user_code.go
T
zhengchiliu ff9add8655 补齐 HTTP 层:实现用户模块、路由与中间件接线、COS 上传及优雅启动
- 新增用户与上传错误码文件及 Recovery 中间件
- 修复 router.go 导入与中间件链,注册用户路由并补 handler 错误码导入
- 补充用户状态常量与 UserGetByWechatOpenID 查询,修订刷新令牌 dto
- 移除 upload 包 OTel 调用,新增 FileUploadCos 上传封装
- 实现 UserService 微信登录/刷新令牌/我的信息/改资料/上传头像
- 裁剪 main.go 配置段并移除 OTel 桥接,补启动与优雅退出
- 新增 configs 示例配置、global 配置结构及 go.mod 依赖
2026-09-27 15:02:01 +08:00

29 lines
778 B
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 服务端错误
// ===== 鉴权 / 登录(21000 - 21999) =====
var (
UserDisabled = NewError(21001, "账号已被禁用")
UserWxLoginFailed = NewError(21002, "微信登录失败")
UserWxCodeInvalid = NewError(21003, "微信 Code 无效")
)
// ===== 资源不存在(22000 - 22999) =====
var (
UserNotFound = NewError(22000, "用户不存在")
)
// ===== 服务端错误(29000 - 29999) =====
var (
UserCreateFailed = NewError(29000, "用户创建失败")
UserUpdateFailed = NewError(29001, "用户更新失败")
)