package e

var MsgFlags = map[int]string{
	SUCCESS:        "ok",
	ERROR:          "fail",
	INVALID_PARAMS: "请求参数错误",

	ERROR_EXIST_COIN:       "币种验证失败",
	ERROR_GET_COIN_FAIL:    "币种信息获取失败",
	ERROR_COUNT_COIN_FAIL:  "币种数量统计失败",
	ERROR_ADD_COIN_FAIL:    "币种添加失败",
	ERROR_UPDATE_COIN_FAIL: "币种更新失败",
	ERROR_DELETE_COIN_FAIL: "币种删除失败",

	ERROR_EXIST_RECOMMEND_COIN:       "币种验证失败",
	ERROR_GET_RECOMMEND_COIN_FAIL:    "币种信息获取失败",
	ERROR_COUNT_RECOMMEND_COIN_FAIL:  "币种数量统计失败",
	ERROR_ADD_RECOMMEND_COIN_FAIL:    "币种添加失败",
	ERROR_UPDATE_RECOMMEND_COIN_FAIL: "币种更新失败",
	ERROR_DELETE_RECOMMEND_COIN_FAIL: "币种删除失败",

	ERROR_EXIST_WALLET:       "钱包验证失败",
	ERROR_GET_WALLET_FAIL:    "钱包信息获取失败",
	ERROR_COUNT_WALLET_FAIL:  "钱包数量统计失败",
	ERROR_ADD_WALLET_FAIL:    "钱包添加失败",
	ERROR_UPDATE_WALLET_FAIL: "钱包更新失败",
	ERROR_DELETE_WALLET_FAIL: "钱包删除失败",

	ERROR_EXIST_CHAIN:       "平行链失败",
	ERROR_GET_CHAIN_FAIL:    "平行链信息获取失败",
	ERROR_COUNT_CHAIN_FAIL:  "平行链数量统计失败",
	ERROR_ADD_CHAIN_FAIL:    "平行链添加失败",
	ERROR_UPDATE_CHAIN_FAIL: "平行链更新失败",
	ERROR_DELETE_CHAIN_FAIL: "平行链删除失败",

	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_SAVE_FILE_FAIL:     "保存文件失败",
	ERROR_UPLOAD_CHECK_FILE_FAIL:    "检查文件失败",
	ERROR_UPLOAD_CHECK_FILE_FORMAT:  "校验文件错误，文件格式或大小有问题",
}

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

	return MsgFlags[ERROR]
}
