common.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package apis
  2. import "context"
  3. type MerchantApiInfo struct {
  4. IsForceUpdate bool `json:"is_force_update"`
  5. MerchantId int64 `json:"merchant_id"`
  6. BaseApiId int64 `json:"base_api_id"`
  7. MerchantChildApiId int64 `json:"merchant_child_api_id" description:"商户基础api id"`
  8. ReuseTime int `json:"reuse_time"`
  9. RangeNo int `json:"range_no"`
  10. OriginReuseTime int `json:"-"`
  11. RandomPercentage int `json:"random_percentage"`
  12. ApiTimeout uint64 `json:"api_timeout" description:"商户接口超时时间"`
  13. ResponseParamConf []ManagementBaseApiParam `json:"response_param_conf" description:"响应参数"`
  14. }
  15. // 数据源原始数据
  16. type ProviderRawData struct {
  17. Data string `json:"data"`
  18. Timestamp int64 `json:"timestamp"`
  19. }
  20. type ManagementBaseApiParam struct {
  21. Required bool `json:"required" description:"是否必选"`
  22. Name string `json:"name" description:"参数名字"`
  23. Mean string `json:"mean" description:"参数含义"`
  24. Type string `json:"type" description:"参数类型,整形、字符串等"`
  25. Example string `json:"example" description:"参数示例"`
  26. Selected bool `json:"selected" description:"是否选择"`
  27. In string `json:"in" description:"出参转换"`
  28. Child []ManagementBaseApiParam `json:"child"`
  29. }
  30. type CommonResp struct {
  31. IsReuse bool `json:"is_reuse"`
  32. LReq []ThirdpartLogWrite `json:"l_req"`
  33. ErrCode int `json:"err_code"`
  34. ErrMsg string `json:"err_msg"`
  35. SySource string `json:"sy_source"`
  36. }
  37. type RawData struct {
  38. Data string `json:"data"`
  39. Timestamp int64 `json:"timestamp"`
  40. }
  41. type CommonReq struct {
  42. Data interface{} `json:"data"`
  43. Code string `json:"code"`
  44. MerchantApiInfo
  45. ProviderMap map[string]MerchantProviderLimitInfo `json:"provider_map"`
  46. ProviderGroup [][]string `json:"provider_group"`
  47. NeedVehicleInfo bool
  48. }
  49. type CommonReply struct {
  50. Data interface{} `json:"data"`
  51. IsReuse bool `json:"is_reuse"`
  52. LReq []ThirdpartLogWrite `json:"l_req"`
  53. ErrCode int `json:"err_code"`
  54. ErrMsg string `json:"err_msg"`
  55. }
  56. type ThirdpartRequest struct {
  57. Ctx context.Context
  58. Params map[string]interface{}
  59. ProviderApiCode string
  60. ProviderMap map[string]MerchantProviderLimitInfo
  61. RangeNo int
  62. Req *CommonReq
  63. Reply *CommonReply
  64. // center中填充
  65. LReq *ThirdpartLogWrite
  66. ProviderInfo MerchantProviderLimitInfo
  67. TryAgain bool
  68. Times int
  69. }