provider_api.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. package apis
  2. type ProviderApi struct {
  3. Id int64 `json:"provider_api_id" description:"三方平台api id"`
  4. ProviderApiCode string `json:"provider_api_code" description:"三方平台api 代号"`
  5. ProviderId int64 `json:"provider_id" description:"三方平台id"`
  6. ThirdpartHost string `json:"thirdpart_host" description:"三方平台域名"`
  7. ThirdpartApiName string `json:"thirdpart_api_name" description:"三方api名称"`
  8. ThirdpartApiRouter string `json:"thirdpart_api_router" description:"三方api路由"`
  9. ThirdpartApiMethod string `json:"thirdpart_api_method" description:"三方api方法"`
  10. Count int64 `json:"count" description:"每天调用量"`
  11. Cost float64 `json:"cost" description:"三方api接口花销"`
  12. State int `json:"state" description:"启用停用"`
  13. CreateTime string `json:"create_time" description:""`
  14. UpdateTime string `json:"update_time" description:""`
  15. ThresholdTimeout int `json:"threshold_timeout"`
  16. ThresholdFailRate float64 `json:"threshold_fail_rate"`
  17. ThresholdNorecordRate float64 `json:"threshold_norecord_rate"`
  18. WarningEnable bool `json:"warning_enable"`
  19. CountType int `json:"count_type"`
  20. CountKey string `json:"count_key"`
  21. CountValue string `json:"count_value"`
  22. Filter string `json:"filter"`
  23. Filters []ProviderParamFilter `json:"filters" orm:"-"`
  24. Timeout int `json:"timeout"`
  25. }
  26. type ProviderApiNew struct {
  27. Id int64 `json:"provider_api_id" description:"三方平台api id"`
  28. ProviderApiCode string `json:"provider_api_code" description:"三方平台api 代号"`
  29. ProviderId int64 `json:"provider_id" description:"三方平台id"`
  30. ThirdpartHost string `json:"thirdpart_host" description:"三方平台域名"`
  31. ThirdpartApiName string `json:"thirdpart_api_name" description:"三方api名称"`
  32. ThirdpartApiRouter string `json:"thirdpart_api_router" description:"三方api路由"`
  33. ThirdpartApiMethod string `json:"thirdpart_api_method" description:"三方api方法"`
  34. Count int64 `json:"count" description:"每天调用量"`
  35. CostString string `json:"cost" description:"三方api接口花销" orm:"-"`
  36. State int `json:"state" description:"启用停用"`
  37. CreateTime string `json:"create_time" description:""`
  38. UpdateTime string `json:"update_time" description:""`
  39. ThresholdTimeout int `json:"threshold_timeout"`
  40. ThresholdFailRate float64 `json:"threshold_fail_rate"`
  41. ThresholdNorecordRate float64 `json:"threshold_norecord_rate"`
  42. WarningEnable bool `json:"warning_enable"`
  43. CountType int `json:"count_type"`
  44. CountKey string `json:"count_key"`
  45. CountValue string `json:"count_value"`
  46. Cost float64 `json:"-" orm:"cost"`
  47. Filter string `json:"filter"`
  48. Filters []ProviderParamFilter `json:"filters" orm:"-"`
  49. Timeout int `json:"timeout"`
  50. }
  51. func (o *ProviderApi) TableName() string {
  52. return "t_gd_provider_api"
  53. }
  54. type ProviderApiParam struct {
  55. Name string `json:"name"`
  56. Type string `json:"type"`
  57. Example string `json:"example"`
  58. In string `json:"in"`
  59. }
  60. type ManagementAddProviderApiReq struct {
  61. ProviderApiCode string `json:"provider_api_code" description:"三方平台api 代号"`
  62. ProviderId int64 `json:"provider_id" description:"三方平台id"`
  63. ThirdpartHost string `json:"thirdpart_host" description:"三方平台域名"`
  64. ThirdpartApiName string `json:"thirdpart_api_name" description:"三方api名称"`
  65. ThirdpartApiRouter string `json:"thirdpart_api_router" description:"三方api路由"`
  66. ThirdpartApiMethod string `json:"thirdpart_api_method" description:"三方api方法"`
  67. Count int64 `json:"count" description:"每天调用量"`
  68. Cost float64 `json:"cost" description:"三方api接口花销"`
  69. State int `json:"state" description:"启用停用"`
  70. Timeout int `json:"timeout"`
  71. }
  72. type ManagementAddProviderApiReply struct {
  73. ProviderApiId int64 `json:"provider_api_id" description:""`
  74. }
  75. type ManagementDelProviderApiReq struct {
  76. ProviderApiId int64 `json:"provider_api_id" description:"三方平台api id"`
  77. }
  78. type ProviderMerchantApiItem struct {
  79. MerchantChildApiId int64 `json:"merchant_child_api_id"`
  80. MerchantName string `json:"merchant_name"`
  81. ApiName string `json:"api_name"`
  82. DayCount int `json:"day_count"`
  83. Inventory int `json:"inventory"`
  84. Enable bool `json:"enable"`
  85. EnableCount int `json:"-"`
  86. }
  87. type ManagementDelProviderApiReply struct{}
  88. type ProviderParamFilter struct {
  89. Name string `json:"name"`
  90. Value string `json:"value"`
  91. }
  92. type ManagementUpdateProviderApiReq struct {
  93. ProviderApiCode string `json:"provider_api_code" description:"三方平台api 代号"`
  94. ProviderApiId int64 `json:"provider_api_id" description:"三方平台api id"`
  95. ThirdpartHost string `json:"thirdpart_host" description:"三方平台域名"`
  96. ThirdpartApiName string `json:"thirdpart_api_name" description:"三方api名称"`
  97. ThirdpartApiRouter string `json:"thirdpart_api_router" description:"三方api路由"`
  98. ThirdpartApiMethod string `json:"thirdpart_api_method" description:"三方api方法"`
  99. Count int64 `json:"count" description:"每天调用量"`
  100. State int `json:"state" description:"启用停用"`
  101. Cost float64 `json:"cost" description:"三方api接口花销"`
  102. CountType int `json:"count_type"`
  103. CountKey string `json:"count_key"`
  104. CountValue string `json:"count_value"`
  105. ProviderMerchantApiList []ProviderMerchantApiItem `json:"provider_merchant_api_list"`
  106. Filters []ProviderParamFilter `json:"filters"`
  107. Timeout int `json:"timeout"`
  108. }
  109. type ManagementUpdateProviderApiReply struct{}
  110. type ManagementGetProviderApiListReq struct {
  111. PageSize int `json:"page_size"`
  112. PageNumber int `json:"page_number" description:""`
  113. ProviderId int64 `json:"provider_id"`
  114. IsAll bool `json:"is_all"`
  115. }
  116. type ManagementGetProviderMerchantApiListReq struct {
  117. ProviderApiId int64 `json:"provider_api_id"`
  118. }
  119. type ManagementGetProviderMerchantApiListReply struct {
  120. ProviderMerchantApiList []ProviderMerchantApiItem `json:"provider_merchant_api_list"`
  121. }
  122. type ManagementGetProviderApiListReply struct {
  123. Total int64 `json:"total" description:""`
  124. PageSize int `json:"page_size" description:"page大小"`
  125. PageNumber int `json:"page_number" description:""`
  126. ProviderApis []ProviderApi `json:"provider_api_list"`
  127. }
  128. type ProviderApiBaseInfo struct {
  129. Id int64 `json:"provider_api_id" description:"三方平台api id"`
  130. ThirdpartHost string `json:"thirdpart_host" description:"三方平台域名"`
  131. ThirdpartApiName string `json:"thirdpart_api_name" description:"三方api名称"`
  132. ThirdpartApiRouter string `json:"thirdpart_api_router" description:"三方api路由"`
  133. ThirdpartApiMethod string `json:"thirdpart_api_method" description:"三方api方法"`
  134. PlatformName string `json:"platform_name" description:"三方应商名"`
  135. ProviderApiCode string `json:"provider_api_code" description:"平台码"`
  136. }
  137. type ManagementGetAllProviderApiReq struct {
  138. ProviderId int64 `json:"provider_id"`
  139. }
  140. type ManagementGetAllProviderApiReply struct {
  141. ProviderApiBaseInfoList []ProviderApiBaseInfo `json:"provider_api_base_info_list"`
  142. }
  143. type ManagementGetProviderApiLimitCountReq struct {
  144. ProviderApiId int64 `json:"provider_api_id"`
  145. }
  146. type ManagementGetProviderApiLimitCountReply struct {
  147. ProviderApiId int64 `json:"provider_api_id"`
  148. Count int64 `json:"count"`
  149. }
  150. type ManagementSetProviderThresholdReq struct {
  151. ProviderApiId int64 `json:"provider_api_id" in:"query" require:"true"`
  152. ThresholdTimeout int `json:"threshold_timeout" in:"query" require:"false"`
  153. ThresholdFailRate float64 `json:"threshold_fail_rate" in:"query" require:"false"`
  154. ThresholdNorecordRate float64 `json:"threshold_norecord_rate" in:"query" require:"false"`
  155. WarningEnable bool `json:"warning_enable"`
  156. }
  157. type ManagementSetProviderThresholdReply struct{}
  158. type GetProviderApiHystrixReq struct {
  159. ProviderApiCode string `json:"provider_api_code" description:"三方平台api 代号"`
  160. }
  161. type GetProviderApiHystrixReply struct {
  162. ID int64 `json:"id"`
  163. MaxConcurrentRequests int64 `json:"max_concurrent_requests"`
  164. RequestVolumeThreshold int64 `json:"request_volume_threshold"`
  165. SleepWindow int64 `json:"sleep_window"`
  166. ErrorPercentThreshold int64 `json:"error_percent_threshold"`
  167. Period int64 `json:"period"`
  168. IsOn int64 `json:"is_on"`
  169. }
  170. type UpdateProviderApiHystrixReq struct {
  171. ID int64 `json:"id"`
  172. ProviderApiName string `json:"provider_api_name"`
  173. ProviderApiCode string `json:"provider_api_code"`
  174. MaxConcurrentRequests int64 `json:"max_concurrent_requests"`
  175. RequestVolumeThreshold int64 `json:"request_volume_threshold"`
  176. SleepWindow int64 `json:"sleep_window"`
  177. ErrorPercentThreshold int64 `json:"error_percent_threshold"`
  178. Period int64 `json:"period"`
  179. IsOn int64 `json:"is_on"`
  180. }
  181. type UpdateProviderApiHystrixReply struct{}
  182. func (o *UpdateProviderApiHystrixReq) TableName() string {
  183. return "t_gd_provider_api_hystrix"
  184. }