package e

// MsgFlags 接口返回信息
var MsgFlags = map[int]string{
	SUCCESS:                        "ok",
	ERROR:                          "fail",
	INVALID_PARAMS:                 "请求参数错误",
	ERROR_AUTH_CHECK_TOKEN_MISSING: "Token缺失",
	ERROR_AUTH_CHECK_TOKEN_FAIL:    "Token鉴权失败",

	ERROR_QUERY_FAIL:               "查询失败",
	ERROR_QUERY_QUOTEMENU_FAIL:     "查询交易端行情报价牌分类菜单失败",
	ERROR_QUERY_OPERATIONMENU_FAIL: "查询交易端功能菜单失败",
	ERROR_OPERATION_FAILED:         "执行失败",
	ERROR_GET_GOODS_FAILED:         "获取商品信息失败",
	ERROR_GET_MARKET_FAILED:        "获取市场信息失败",
	ERROR_GET_MARKETRUN_FAILED:     "获取市场运行参数失败",
	ERROR_GET_RUNSTEP_FAILED:       "获取市场开休市计划失败",
	ERROR_QUERY_TIME_FORMAT_FAIL:   "错误的时间格式",
	ERROR_ADD_MAX_3:                "每日最多只能新增3条留言",
	ERROR_GET_EXEXCHANGE_FAILED:    "获取外部交易所信息失败",
	ERROR_GET_QUOTE_FAILED:         "获取行情信息失败",

	ERROR_UPLOAD_SAVE_IMAGE_FAIL:    "保存图片失败",
	ERROR_UPLOAD_CHECK_IMAGE_FAIL:   "检查图片失败",
	ERROR_UPLOAD_CHECK_IMAGE_FORMAT: "校验图片错误，图片格式或大小有问题",
	ERROR_CFG_KEY_FAIL:              "错误的KEY值",
	ERROR_CFG_FILE_FAIL:             "读取配置文件失败",
	ERROR_CFG_JSON_FAIL:             "配置文件格式错误",
}

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

	return MsgFlags[ERROR]
}
