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-24 23:34:07 +08:00
|
|
|
BalanceNotEnough: "余额不足",
|
|
|
|
|
MaxPriceExceeded: "超过最大接受单价",
|
|
|
|
|
NoNumbers: "号码不足",
|
|
|
|
|
RentalsNotFinished: "需要先完成部分租赁才能继续租赁",
|
|
|
|
|
|
|
|
|
|
SmsCancel: "短信验证码_手机号过期",
|
|
|
|
|
SmsNoActivation: "短信验证码_手机号不存在",
|
|
|
|
|
SmsWaitCode: "短信验证码_等待验证码",
|
|
|
|
|
SmsLongNumWaitCode: "短信验证码_长效号码已唤醒",
|
|
|
|
|
SmsNotExisted: "号码不存在",
|
|
|
|
|
SmsNotExpired: "号码未过期无法删除",
|
2025-07-28 18:15:40 +08:00
|
|
|
SmsNotAutoRenew: "短效号码无法自动续期",
|
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-24 23:34:07 +08:00
|
|
|
BalanceNotEnough: "balance not enough",
|
|
|
|
|
MaxPriceExceeded: "max price exceeded",
|
|
|
|
|
NoNumbers: "no numbers",
|
|
|
|
|
RentalsNotFinished: "need to finish some rentals before renting more",
|
|
|
|
|
|
|
|
|
|
SmsCancel: "sms code expired",
|
|
|
|
|
SmsNoActivation: "sms code not exist",
|
|
|
|
|
SmsWaitCode: "sms code wait for input",
|
|
|
|
|
SmsLongNumWaitCode: "sms code long num wake up",
|
|
|
|
|
SmsNotExisted: "number not exist",
|
|
|
|
|
SmsNotExpired: "number not expired, can not delete",
|
2025-07-28 18:15:40 +08:00
|
|
|
SmsNotAutoRenew: "num can not auto renew",
|
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-24 23:34:07 +08:00
|
|
|
|
|
|
|
|
//余额不足
|
|
|
|
|
BalanceNotEnough = 10010
|
|
|
|
|
//超过最大接受单价
|
|
|
|
|
MaxPriceExceeded = 10011
|
|
|
|
|
//号码不足
|
|
|
|
|
NoNumbers = 10012
|
|
|
|
|
// Need to finish some rentals before renting more
|
|
|
|
|
RentalsNotFinished = 10013
|
|
|
|
|
|
|
|
|
|
//短信验证码_手机号过期
|
|
|
|
|
SmsCancel = 20014
|
|
|
|
|
//短信验证码_手机号不存在
|
|
|
|
|
SmsNoActivation = 20015
|
|
|
|
|
//短信验证码_等待验证码
|
|
|
|
|
SmsWaitCode = 20016
|
|
|
|
|
//短信验证码_长效号码已唤醒
|
|
|
|
|
SmsLongNumWaitCode = 20017
|
|
|
|
|
//号码不存在
|
|
|
|
|
SmsNotExisted = 20018
|
|
|
|
|
//号码未过期无法删除
|
|
|
|
|
SmsNotExpired = 20019
|
2025-07-28 18:15:40 +08:00
|
|
|
//短效号码无法自动续期
|
|
|
|
|
SmsNotAutoRenew = 20020
|
2025-07-12 15:25:26 +08:00
|
|
|
)
|