package e

var MsgFlags = map[int]string{
	OK:                "ok",
	SUCCESS:           "ok",
	NOT_OPEN:          "未开启",
	ERROR:             "fail",
	PONG:              "pong",
	INVALID_PARAMS:    "请求参数错误",
	INVALID_SYSTEM:    "系统环境异常",
	NO_PERMISSION:     "没有权限",
	CALL_REMOTE_ERROR: "rpc调用失败",
	NO_RECORD:         "数据不存在",

	ERROR_USER_LOGIN_FAIL:    "登录失败:用户名或密码错误",
	ERROR_USER_PHONE_FAIL:    "用户暂未注册 请前往注册",
	ERROR_USER_CHPWD_FAIL:    "修改密码失败",
	ERROR_USER_PWD_FAIL:      "账号或密码错误",
	ERROR_USER_CREATE_FAIL:   "用户创建失败",
	ERROR_USER_NOT_EXIST:     "用户不存在",
	ERROR_USER_FIXED_FAIL:    "完善信息失败",
	ERROR_USER_REGISTED:      "用户已注册 请登录",
	ERROR_USER_FIXPASSWORD:   "非游客用户 请前往忘记密码修改",
	ERROR_USER_PHONE_NUM:     "手机号码异常",
	ERROR_USER_NAME_ILLEGAL:  "用户名不规范",
	ERROR_USER_FRIEND_EXIST:  "名片已存在",
	ERROR_USER_FRIEND_MAX:    "名片已达上限",
	ERROR_USER_PHONE_EXIST:   "手机号码已注册",
	ERROR_USER_ASSETS_MARKED: "已完成评价",
	ERROR_USER_PROJECT_MAX:   "无法创建更多项目",
	ERROR_USER_MISS_IMAGE:    "用户缺少形象",
	ERROR_VISITOR_MISS_NAME:  "游客缺少名称",

	ERROR_PROJECT_NOT_EXIST:  "查询项目不存在",
	ERROR_PROJECT_NO_PUBLISH: "当前项目未发布",
	ERROR_PUBLISH_NO_MAPID:   "项目发布缺少场景ID",

	ERROR_SMS_SEND_FAIL:    "验证码发送失败",
	ERROR_SMS_CODE_FAIL:    "验证码不匹配",
	ERROR_SMS_CODE_COOLING: "验证码冷却中 稍后再试",

	ERROR_ACTIVITY_NO_REWARD: "活动奖励已发完",

	ERROR_DRAW_NO_BONUS:    "未抽取到奖品 再接再厉",
	ERROR_DRAW_NO_TIMES:    "抽奖次数已用完",
	ERROR_DRAW_FAIL:        "抽奖操作失败",
	ERROR_DRAW_DONE:        "已完成抽奖",
	ERROR_DRAW_NO_MORE:     "本轮抽奖已结束 没有更多奖励了",
	ERROR_DRAW_NEED_UPLOAD: "需要完成上传",
	ERROR_DRAW_CONFIG:      "抽奖参数配置错误",

	ERROR_AIUNKOWN_CREATE: "问题创建失败",
	ERROR_AIUNKOWN_DELETE: "问题删除失败",

	ERROR_AI_NO_TIMES: "ai问答无多余次数",

	ERROR_AUTH_CHECK_TOKEN_FAIL:     "Token鉴权失败",
	ERROR_AUTH_CHECK_TOKEN_TIMEOUT:  "Token已超时",
	ERROR_AUTH_TOKEN:                "Token生成失败",
	ERROR_AUTH:                      "Token错误",
	ERROR_UPLOAD_SAVE_IMAGE_FAIL:    "保存图片失败",
	ERROR_UPLOAD_CHECK_IMAGE_FAIL:   "检查图片失败",
	ERROR_UPLOAD_CHECK_IMAGE_FORMAT: "校验图片错误，图片格式或大小有问题",
	ERROR_UPLOAD_CHECK_SIZE_OVER:    "使用空间超出，请升级用户等级",
}

// GetMsg get error information based on Code
func GetMsg(code int) string {
	msg, ok := MsgFlags[code]
	if ok {
		return msg
	}

	return MsgFlags[ERROR]
}
