package param_v1_0

import (
	"gd_management_gateway/params/param_base"
	"gd_management_gateway/rpc_apis/gd_management"
)

//商户数据api列表
type ManagementGetMerchantDataApiListByDayReq struct {
	param_base.BasicParam
	MerchantId  int64  `json:"merchant_id" description:"" in:"query"`
	PageNumber  int    `json:"page_number" description:"" in:"query"`
	DataApiName string `json:"data_api_name" in:"query"`
	PageSize    int    `json:"page_size" in:"query"`
	IsAll       bool   `json:"is_all" description:"" in:"query"`
}

type ManagementGetMerchantDataApiListByDayResp struct {
	param_base.SimpleResp
	Data gd_management.ManagementGetMerchantDataApiListByDayReply `json:"data"`
}

//商户数据api列表
type ManagementGetMerchantDataApiListByTotalReq struct {
	param_base.BasicParam
	MerchantId  int64  `json:"merchant_id" description:"" in:"query"`
	PageNumber  int    `json:"page_number" description:"" in:"query"`
	DataApiName string `json:"data_api_name" in:"query"`
	PageSize    int    `json:"page_size" in:"query"`
	IsAll       bool   `json:"is_all" description:"" in:"query"`
}

type ManagementGetMerchantDataApiListByTotalResp struct {
	param_base.SimpleResp
	Data gd_management.ManagementGetMerchantDataApiListByTotalReply `json:"data"`
}

//商户数据api列表
type ManagementGetMerchantDataApiListReq struct {
	param_base.BasicParam
	MerchantId uint64 `json:"merchant_id" description:"" in:"query"`
	PageNumber int    `json:"page_number" description:"" in:"query"`
	IsAll      bool   `json:"is_all" description:"" in:"query"`
}

type ManagementGetMerchantDataApiListResp struct {
	param_base.SimpleResp
	Data gd_management.ManagementGetMerchantDataApiListReply `json:"data"`
}

//获取商户数据api对应的基础api列表
type ManagementGetMerchantBaseApiListReq struct {
	param_base.BasicParam
	MerchantDataApiId uint64 `json:"merchant_data_api_id" description:"" in:"query"`
}

type ManagementGetMerchantBaseApiListResp struct {
	param_base.SimpleResp
	Data gd_management.ManagementGetMerchantBaseApiListReply `json:"data" description:""`
	//Data []gd_management.MerchantBaseApiListItem `json:"data" description:""`
}

type ManagementGetMerchantBaseApiInfoReq struct {
	param_base.BasicParam
	MerchantChildApiId uint64 `json:"merchant_child_api_id" description:"商户的某数据api的某子api的id" in:"query"`
}

type ManagementGetMerchantBaseApiInfoResp struct {
	param_base.SimpleResp
	Data gd_management.ManagementGetMerchantBaseApiInfoReply `json:"data" description:""`
}

//更新商户数据api中某基础api信息和三方源信息
type ManagementUpdateMerchantBaseApiReq struct {
	param_base.BasicParam
	MerchantId int64                                             `json:"merchant_id" description:"关联唯一id" require:"true" in:"path"`
	UpdateInfo gd_management.ManagementUpdateMerchantBaseApiReq `json:"update_info" description:"" in:"body"`
}

type ManagementUpdateMerchantBaseApiResp struct {
	param_base.SimpleResp
}

type MerchantBaseApiArray struct {
	MerchantChildApiIds []uint64 `json:"merchant_child_api_ids" description:"按优先级排好序的id"`
}

//修改商户数据api配额
type ManagementSetMerchantDataApiQuotaBody struct {
	MerchantDataApiId uint64 `json:"merchant_data_api_id"`
	DayCount          int    `json:"day_count"`
	Count             int    `json:"count"`
	DayNumber         int    `json:"day_number"`
}

type ManagementSetMerchantDataApiQuotaReq struct {
	param_base.BasicParam
	MerchantId int64                                 `json:"merchant_id" description:"关联唯一id" require:"true" in:"path"`
	Body       ManagementSetMerchantDataApiQuotaBody `json:"body" require:"true" in:"body"`
}

type ManagementSetMerchantDataApiQuotaResp struct {
	param_base.SimpleResp
}

type ManagementGetMerchantDataApiQuotaReq struct {
	param_base.BasicParam
	MerchantDataApiId int64 `json:"merchant_data_api_id" description:"" in:"query"`
}

type ManagementGetMerchantDataApiQuotaResp struct {
	param_base.SimpleResp
	Data gd_management.ManagementGetMerchantDataApiQuotaReply `json:"data"`
}

type ManagementAddMerchantDataApiBody struct {
	MerchantId     int64 `json:"merchant_id"`
	QueryTypeId    int64 `json:"query_type_id"`
	DataApiComboId int64 `json:"combo_id"`
}

type ManagementAddMerchantDataApiReq struct {
	param_base.BasicParam
	Body ManagementAddMerchantDataApiBody `json:"body" in:"body" require:"true"`
}

type ManagementAddMerchantDataApiResp struct {
	param_base.SimpleResp
}

type MerchantAddBaseApiReq struct {
	MerchantDataApiId uint64   `json:"merchant_data_api_id" description:""`
	BaseApiIds        []uint64 `json:"base_api_ids" description:""`
}
type ManagementAddMerchantBaseApiReq struct {
	param_base.BasicParam
	Data MerchantAddBaseApiReq `json:"data" in:"body"`
}

type ManagementAddMerchantBaseApiResp struct {
	param_base.SimpleResp
	//MerchantChildApiId uint64 `json:"merchant_child_api_id" description:""`
}

type ManagementExportMerchantBaseApiFileReq struct {
	param_base.BasicParam
	FileType          int   `json:"file_type" in:"query"`
	MerchantDataApiId int64 `json:"merchant_data_api_id" in:"query"`
}

type ManagementExportMerchantBaseApiFileResp struct {
	param_base.SimpleResp
	DownloadFile string `json:"download_file"`
}

type ManagementDelMerchantDataApiReq struct {
	param_base.BasicParam
	MerchantDataApiId int64 `json:"merchant_data_api_id" in:"path" require:"true"`
}

type ManagementDelMerchantDataApiResp struct {
	param_base.SimpleResp
}

type ManagementGetMerchantBaseApiListAllReq struct {
	param_base.BasicParam
	MerchantId  int64 `json:"merchant_id" description:"" in:"query"`
	OnlyBaseApi bool  `json:"only_base_api" in:"query"`
}

type ManagementGetMerchantBaseApiListAllResp struct {
	param_base.SimpleResp
	Data gd_management.ManagementGetMerchantBaseApiListAllReply `json:"data" description:""`
	//Data []gd_management.MerchantBaseApiListItem `json:"data" description:""`
}

type ManagementSetDayCountLimitReq struct {
	param_base.BasicParam
	MerchantId int64                          `json:"merchant_id" description:"关联唯一id" require:"true" in:"path"`
	Body       ManagementSetDayCountLimitBody `json:"body" require:"true" in:"body"`
}

type ManagementSetDayCountLimitResp struct {
	param_base.SimpleResp
}

//修改商户数据api每日调用上限
type ManagementSetDayCountLimitBody struct {
	MerchantDataApiId int64 `json:"merchant_data_api_id" description:""`
	DayCount          int   `json:"day_count" description:"日调用量上限"`
	DayTotalCount     int   `json:"day_total_count" description:"日即查量上限"`
}

//修改商户数据api配额
type UpdateManagementSetMerchantDataApiBody struct {
	MerchantDataApiId int64  `json:"merchant_data_api_id"`
	CountThresholds   string `json:"count_thresholds"`
	DayThresholds     string `json:"day_thresholds"`

	TotalComboId            int64 `json:"total_combo_id"`
	TotalComboIncreaseCount int64 `json:"total_combo_increase_count"`

	DayComboId            int64  `json:"day_combo_id"`
	DayComboIncreaseCount int64  `json:"day_combo_increase_count"`
	DayComboIncreaseDays  int    `json:"day_combo_increase_days"`
	DayTotalCount         int    `json:"day_total_count"`
	IpWhitelist           string `json:"ip_whitelist"`
	IpWhitelistEnable     bool   `json:"ip_whitelist_enable"`
	CountThresholdsEnable bool   `json:"count_thresholds_enable"`
	TotalComboDayCount    int    `json:"total_combo_day_count"`
}

type UpdateManagementSetMerchantDataApiReq struct {
	param_base.BasicParam
	MerchantId int64                                  `json:"merchant_id" description:"关联唯一id" require:"true" in:"path"`
	Body       UpdateManagementSetMerchantDataApiBody `json:"body" require:"true" in:"body"`
}

type UpdateManagementSetMerchantDataApiResp struct {
	param_base.SimpleResp
}

type UpdateMerchantDataApiAliasBody struct {
	MerchantDataApiId int64  `json:"merchant_data_api_id"`
	Alias             string `json:"alias"`
}

type UpdateMerchantDataApiAliasReq struct {
	param_base.BasicParam
	Body UpdateMerchantDataApiAliasBody `json:"body" require:"true" in:"body"`
}

type UpdateMerchantDataApiAliasResp struct {
	param_base.SimpleResp
}
