package gd_management

type ProviderApi struct {
	Id                    int64                 `json:"provider_api_id" description:"三方平台api id"`
	ProviderApiCode       string                `json:"provider_api_code" description:"三方平台api 代号"`
	ProviderId            int64                 `json:"provider_id" description:"三方平台id"`
	ThirdpartHost         string                `json:"thirdpart_host" description:"三方平台域名"`
	ThirdpartApiName      string                `json:"thirdpart_api_name" description:"三方api名称"`
	ThirdpartApiRouter    string                `json:"thirdpart_api_router" description:"三方api路由"`
	ThirdpartApiMethod    string                `json:"thirdpart_api_method" description:"三方api方法"`
	Cost                  float64               `json:"cost" description:"三方api接口花销"`
	Count                 int64                 `json:"count" description:"每天调用量"`
	State                 byte                  `json:"state" description:"启用停用"`
	CreateTime            string                `json:"create_time" description:""`
	UpdateTime            string                `json:"update_time" description:""`
	ThresholdTimeout      int                   `json:"threshold_timeout"`
	ThresholdFailRate     float64               `json:"threshold_fail_rate"`
	ThresholdNorecordRate float64               `json:"threshold_norecord_rate"`
	WarningEnable         bool                  `json:"warning_enable"`
	CountType             int                   `json:"count_type"`
	CountKey              string                `json:"count_key"`
	CountValue            string                `json:"count_value"`
	Filters               []ProviderParamFilter `json:"filters"`
	Timeout               int                   `json:"timeout"`
}

type ManagementAddProviderApiReq struct {
	ProviderApiCode    string  `json:"provider_api_code" description:"三方平台api 代号"`
	ProviderId         int64   `json:"provider_id" description:"三方平台id"`
	ThirdpartHost      string  `json:"thirdpart_host" description:"三方平台域名"`
	ThirdpartApiName   string  `json:"thirdpart_api_name" description:"三方api名称"`
	ThirdpartApiRouter string  `json:"thirdpart_api_router" description:"三方api路由"`
	ThirdpartApiMethod string  `json:"thirdpart_api_method" description:"三方api方法"`
	Count              int64   `json:"count" description:"每天调用量"`
	Cost               float64 `json:"cost" description:"三方api接口花销"`
	State              int     `json:"state" description:"启用停用"`
	Timeout            int     `json:"timeout"`
}

type ManagementAddProviderApiReply struct {
	ProviderApiId int64 `json:"provider_api_id" description:"三方平台api id"`
}
type ManagementDelProviderApiReq struct {
	ProviderApiId int64 `json:"provider_api_id" description:"三方平台api id"`
}
type ManagementDelProviderApiReply struct {
}

type ProviderParamFilter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}
type ManagementUpdateProviderApiReq struct {
	ProviderApiCode         string                    `json:"provider_api_code" description:"三方平台api 代号"`
	ProviderApiId           int64                     `json:"provider_api_id" description:"三方平台api id"`
	ThirdpartHost           string                    `json:"thirdpart_host" description:"三方平台域名"`
	ThirdpartApiName        string                    `json:"thirdpart_api_name" description:"三方api名称"`
	ThirdpartApiRouter      string                    `json:"thirdpart_api_router" description:"三方api路由"`
	ThirdpartApiMethod      string                    `json:"thirdpart_api_method" description:"三方api方法"`
	Count                   int64                     `json:"count" description:"每天调用量"`
	State                   int                       `json:"state" description:"启用停用"`
	Cost                    float64                   `json:"cost" description:"三方api接口花销"`
	CountType               int                       `json:"count_type"`
	CountKey                string                    `json:"count_key"`
	CountValue              string                    `json:"count_value"`
	ProviderMerchantApiList []ProviderMerchantApiItem `json:"provider_merchant_api_list"`
	Filters                 []ProviderParamFilter     `json:"filters"`
	Timeout                 int                       `json:"timeout"`
}

type ManagementUpdateProviderApiReply struct {
}

type ManagementGetProviderApiListReq struct {
	PageSize   int   `json:"page_size"  description:"页大小"`
	PageNumber int   `json:"page_number" description:"页数"`
	ProviderId int64 `json:"provider_id" description:"平台id" in:"query"`
	IsAll      bool  `json:"is_all"`
}
type ManagementGetProviderApiListReply struct {
	Total        int64         `json:"total" description:"总数据量"`
	PageSize     int           `json:"page_size" description:"页大小"`
	PageNumber   int           `json:"page_number" description:"页数"`
	ProviderApis []ProviderApi `json:"provider_api_list"`
}

type ProviderApiBaseInfo struct {
	Id                 int64  `json:"provider_api_id" description:"三方平台api id"`
	ThirdpartHost      string `json:"thirdpart_host" description:"三方平台域名"`
	ThirdpartApiName   string `json:"thirdpart_api_name" description:"三方api名称"`
	ThirdpartApiRouter string `json:"thirdpart_api_router" description:"三方api路由"`
	ThirdpartApiMethod string `json:"thirdpart_api_method" description:"三方api方法"`
	PlatformName       string `json:"platform_name" description:"三方应商名"`
	ProviderApiCode    string `json:"provider_api_code" description:"平台码"`
}

type ManagementGetAllProviderApiReq struct {
	ProviderId int64 `json:"provider_id"`
}
type ManagementGetAllProviderApiReply struct {
	ProviderApiBaseInfoList []ProviderApiBaseInfo `json:"provider_api_base_info_list"`
}

type ManagementSetProviderThresholdReq struct {
	ProviderApiId         int64   `json:"provider_api_id" in:"query" require:"true"`
	ThresholdTimeout      int     `json:"threshold_timeout" in:"query" require:"false"`
	ThresholdFailRate     float64 `json:"threshold_fail_rate" in:"query" require:"false"`
	ThresholdNorecordRate float64 `json:"threshold_norecord_rate" in:"query" require:"false"`
	WarningEnable         bool    `json:"warning_enable" in:"query"`
}

type ManagementSetProviderThresholdReply struct {
}

type ProviderMerchantApiItem struct {
	MerchantChildApiId int64  `json:"merchant_child_api_id"`
	MerchantName       string `json:"merchant_name"`
	ApiName            string `json:"api_name"`
	DayCount           int    `json:"day_count"`
	Inventory          int    `json:"inventory"`
	Enable             bool   `json:"enable"`
}

type ManagementGetProviderMerchantApiListReq struct {
	ProviderApiId int64 `json:"provider_api_id"`
}

type ManagementGetProviderMerchantApiListReply struct {
	ProviderMerchantApiList []ProviderMerchantApiItem `json:"provider_merchant_api_list"`
}

type GetProviderApiHystrixReq struct {
	ProviderApiCode string `json:"provider_api_code" description:"三方平台api 代号"`
}

type GetProviderApiHystrixReply struct {
	ID                     int64 `json:"id"`
	MaxConcurrentRequests  int64 `json:"max_concurrent_requests"`
	RequestVolumeThreshold int64 `json:"request_volume_threshold"`
	SleepWindow            int64 `json:"sleep_window"`
	ErrorPercentThreshold  int64 `json:"error_percent_threshold"`
	Period                 int64 `json:"period"`
	IsOn                   int64 `json:"is_on"`
}

type UpdateProviderApiHystrixReq struct {
	ID                     int64  `json:"id"`
	ProviderApiName        string `json:"provider_api_name"`
	ProviderApiCode        string `json:"provider_api_code"`
	MaxConcurrentRequests  int64  `json:"max_concurrent_requests"`
	RequestVolumeThreshold int64  `json:"request_volume_threshold"`
	SleepWindow            int64  `json:"sleep_window"`
	ErrorPercentThreshold  int64  `json:"error_percent_threshold"`
	Period                 int64  `json:"period"`
	IsOn                   int64  `json:"is_on"`
}

type UpdateProviderApiHystrixReply struct{}

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

type UpdateMerchantDataApiAliasReply struct{}
