2025-07-12 15:25:26 +08:00
|
|
|
package statuscode
|
|
|
|
|
|
|
|
|
|
var StatusCodeZh = map[int]string{
|
|
|
|
|
Success: "成功",
|
|
|
|
|
AccountExisted: "账号已存在",
|
|
|
|
|
AccountOrPasswordError: "账号或密码错误",
|
|
|
|
|
PassWordNotMatch: "密码不一致",
|
2025-07-18 18:05:56 +08:00
|
|
|
ServerError: "服务端错误,请联系管理员",
|
|
|
|
|
EmailEmpty: "邮箱不能为空",
|
|
|
|
|
EmailFormatError: "邮箱格式不正确",
|
|
|
|
|
PasswordEmpty: "密码不能为空",
|
|
|
|
|
ConfirmPasswordEmpty: "确认密码不能为空",
|
|
|
|
|
VerifyCodeError: "验证码错误",
|
2025-07-12 15:25:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var StatusCodeEn = map[int]string{
|
|
|
|
|
Success: "success",
|
|
|
|
|
AccountExisted: "account already existed",
|
|
|
|
|
AccountOrPasswordError: "account or password error",
|
|
|
|
|
PassWordNotMatch: "password not match",
|
2025-07-18 18:05:56 +08:00
|
|
|
ServerError: "server error, please contact admin",
|
|
|
|
|
EmailEmpty: "email can not be empty",
|
|
|
|
|
EmailFormatError: "email format error",
|
|
|
|
|
PasswordEmpty: "password can not be empty",
|
|
|
|
|
ConfirmPasswordEmpty: "confirm password can not be empty",
|
|
|
|
|
VerifyCodeError: "verify code error",
|
2025-07-12 15:25:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetMsg(code int, lang string) string {
|
|
|
|
|
if lang == "zh" {
|
|
|
|
|
return StatusCodeZh[code]
|
|
|
|
|
} else {
|
|
|
|
|
return StatusCodeEn[code]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
Success = 200
|
|
|
|
|
|
|
|
|
|
//账号不存在
|
|
|
|
|
AccountNotFound = 10001
|
|
|
|
|
//账号已存在
|
|
|
|
|
AccountExisted = 10002
|
|
|
|
|
//密码错误
|
|
|
|
|
AccountOrPasswordError = 10003
|
|
|
|
|
//密码不一致
|
|
|
|
|
PassWordNotMatch = 10004
|
2025-07-18 18:05:56 +08:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
ServerError = 500
|
|
|
|
|
|
|
|
|
|
//邮箱不能为空
|
|
|
|
|
EmailEmpty = 10005
|
|
|
|
|
//邮箱格式不正确
|
|
|
|
|
EmailFormatError = 10006
|
|
|
|
|
//密码不能为空
|
|
|
|
|
PasswordEmpty = 10007
|
|
|
|
|
//确认密码不能为空
|
|
|
|
|
ConfirmPasswordEmpty = 10008
|
|
|
|
|
//验证码错误
|
|
|
|
|
VerifyCodeError = 10009
|
2025-07-12 15:25:26 +08:00
|
|
|
)
|