common.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. }
  14. // 数据源原始数据
  15. type ProviderRawData struct {
  16. Data string `json:"data"`
  17. Timestamp int64 `json:"timestamp"`
  18. }
  19. type ManagementBaseApiParam struct {
  20. Required bool `json:"required" description:"是否必选"`
  21. Name string `json:"name" description:"参数名字"`
  22. Mean string `json:"mean" description:"参数含义"`
  23. Type string `json:"type" description:"参数类型,整形、字符串等"`
  24. Example string `json:"example" description:"参数示例"`
  25. Selected bool `json:"selected" description:"是否选择"`
  26. In string `json:"in" description:"出参转换"`
  27. Child []ManagementBaseApiParam `json:"child"`
  28. }
  29. type CommonResp struct {
  30. IsReuse bool `json:"is_reuse"`
  31. LReq []ThirdpartLogWrite `json:"l_req"`
  32. ErrCode int `json:"err_code"`
  33. ErrMsg string `json:"err_msg"`
  34. SySource string `json:"sy_source"`
  35. }
  36. type RawData struct {
  37. Data string `json:"data"`
  38. Timestamp int64 `json:"timestamp"`
  39. }
  40. type CommonReq struct {
  41. Data interface{} `json:"data"`
  42. Code string `json:"code"`
  43. MerchantApiInfo
  44. ProviderMap map[string]MerchantProviderLimitInfo `json:"provider_map"`
  45. ProviderGroup [][]string `json:"provider_group"`
  46. NeedVehicleInfo bool
  47. }
  48. type CommonReply struct {
  49. Data interface{} `json:"data"`
  50. IsReuse bool `json:"is_reuse"`
  51. LReq []ThirdpartLogWrite `json:"l_req"`
  52. ErrCode int `json:"err_code"`
  53. ErrMsg string `json:"err_msg"`
  54. }
  55. type ThirdpartRequest struct {
  56. Ctx context.Context
  57. Params map[string]interface{}
  58. ProviderApiCode string
  59. ProviderMap map[string]MerchantProviderLimitInfo
  60. RangeNo int
  61. Req *CommonReq
  62. Reply *CommonReply
  63. // center中填充
  64. LReq *ThirdpartLogWrite
  65. ProviderInfo MerchantProviderLimitInfo
  66. TryAgain bool
  67. Times int
  68. }