2025-05-16 18:04:52 +08:00

29 lines
1.1 KiB
Go
Raw Permalink 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
// **** 修改了错误码定义一定要手工项目根目录执行命令生成对应go文件go generate ./... ****
//go:generate go run ../../cmd/tools/generator/errcode.go
const (
Ok = 0 // ok
ServerError = 1 // 服务器错误
DBError = 2 // 数据库错误
NotLogin = 3 // 没有登录,重定向到登录页面
HeaderParamsInvalid = 4 // http请求头参数不合法
TokenInvalid = 5 // http请求token不合法
UserOrPassInValid = 7 // 用户名或密码错误
NoPermission = 8 // 没有权限
ParamsInvalid = 9 // 参数不合法
DBInsertDuplicate = 10 // 数据重复
GameServerNotRunning = 11 // 游戏服务器区服没有运行
)
// sdk系统错误码给内部别的游戏调用api返回
// 错误码格式是系统号100-999*100 + 100 + 错误码自增
const (
CDKey_ = 100 // cdkey系统占用100
CDKeyInvalid = 100100 // cdkey无效
CDKeyAlreadyUsed = 100101 // cdkey已经使用过
CDKeyAlreadyExpired = 100102 // cdkey过期
)