package e

var MsgFlags = map[int]string{
	SUCCESS:               "ok",
	UpdatePasswordSuccess: "修改密码成功",
	NotExistInentifier:    "该第三方账号未绑定",
	ERROR:                 "fail",
	InvalidParams:         "请求参数错误",

	ErrorExistNick:          "已存在该昵称",
	ErrorExistUser:          "已存在该用户名",
	ErrorNotExistUser:       "该用户不存在",
	ErrorNotCompare:         "账号密码错误",
	ErrorNotComparePassword: "两次密码输入不一致",
	ErrorFailEncryption:     "加密失败",
	ErrorNotExistProduct:    "该商品不存在",
	ErrorNotExistAddress:    "该收获地址不存在",
	ErrorExistFavorite:      "已收藏该商品",

	ErrorBossCheckTokenFail:        "商家的Token鉴权失败",
	ErrorBossCheckTokenTimeout:     "商家TOken已超时",
	ErrorBossToken:                 "商家的Token生成失败",
	ErrorBoss:                      "商家Token错误",
	ErrorBossInsufficientAuthority: "商家权限不足",
	ErrorBossProduct:               "商家读文件错误",

	ErrorAuthCheckTokenFail:        "Token鉴权失败",
	ErrorAuthCheckTokenTimeout:     "TOken已超时",
	ErrorAuthToken:                 "Token生成失败",
	ErrorAuth:                      "Token错误",
	ErrorAuthInsufficientAuthority: "权限不足",
	ErrorReadFile:                  "读文件失败",
	ErrorSendEmail:                 "发送邮件失败",
	ErrorCallApi:                   "调用接口失败",
	ErrorUnmarshalJson:             "解码JSON失败",

	ErrorUploadFile:    "上传失败",
	ErrorAdminFindUser: "管理员查询用户失败",

	ErrorDatabase: "数据库操作出错,请重试",

	ErrorOss: "OSS配置错误",

	ErrorExistShopName:    "店铺已被注册，请检查店铺名称和统一社会信用码",
	ErrorNotExistShopName: "店铺不存在",
	ErrorNotAdmin:         "非管理员",

	InvalidToken: "Token验证失败",

	ErrNoDomain: "环境变量必须要有",
	ErrTelNum:   "手机号码错误",
	ErrNoCode:   "验证码必须要有",
	ErrNoID:     "ID缺少",
	ErrNickName: "请填写正确的姓名项",
	InvalidID:   "身份证长度18位",
	InvalidPas:  "密码不小于6位",

	ErrStatus:    "状态非法",
	ErrNoType:    "缺少类型",
	ErrNoUserID:  "缺少用户ID",
	ErrNoName:    "缺少名称",
	ErrNoDepCode: "缺少部门code",
	ErrNoTitle:   "缺少标题",
	ErrNoUrl:     "缺少url",
	ErrNoMethod:  "缺少method",
}

// GetMsg 获取状态码对应信息
func GetMsg(code int) string {
	msg, ok := MsgFlags[code]
	if ok {
		return msg
	}
	return MsgFlags[ERROR]
}
