1\
This commit is contained in:
36
common/statuscode/status_code.go
Normal file
36
common/statuscode/status_code.go
Normal file
@ -0,0 +1,36 @@
|
||||
package statuscode
|
||||
|
||||
var StatusCodeZh = map[int]string{
|
||||
Success: "成功",
|
||||
AccountExisted: "账号已存在",
|
||||
AccountOrPasswordError: "账号或密码错误",
|
||||
PassWordNotMatch: "密码不一致",
|
||||
}
|
||||
|
||||
var StatusCodeEn = map[int]string{
|
||||
Success: "success",
|
||||
AccountExisted: "account already existed",
|
||||
AccountOrPasswordError: "account or password error",
|
||||
PassWordNotMatch: "password not match",
|
||||
}
|
||||
|
||||
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
|
||||
)
|
||||
Reference in New Issue
Block a user