auth_check.go 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package apis
  4. type ManagementCheckApiReq struct {
  5. Header map[string]string `json:"header" description:"header 非加密"`
  6. Method string `json:"method" description:"请求方法 POST PUT ..."`
  7. Router string `json:"router"`
  8. Ip string `json:"ip" description:"请求的ip地址"`
  9. RequestParam []byte `json:"request_param" description:"query参数"`
  10. OriginRequestParam string `json:"origin_request_param"`
  11. }
  12. type ManagementBaseApiParam struct {
  13. Required bool `json:"required" description:"是否必选"`
  14. Name string `json:"name" description:"参数名字"`
  15. Mean string `json:"mean" description:"参数含义"`
  16. Type string `json:"type" description:"参数类型,整形、字符串等"`
  17. Example string `json:"example" description:"参数示例"`
  18. Selected bool `json:"selected" description:"是否选择"`
  19. In string `json:"in" description:"出参转换"`
  20. Child []ManagementBaseApiParam `json:"child"`
  21. }
  22. type RateLimitToken struct {
  23. AppKey string `json:"app_key" `
  24. Router string `json:"router"`
  25. RouterToken string `json:"router_token"`
  26. MerchantToken string `json:"merchant_token"`
  27. }
  28. type CheckMerchantApiResult struct {
  29. MerchantId int64 `json:"merchant_id" description:"商户id"`
  30. IsHttpCode int `json:"is_http_code"`
  31. MerchantChildApiId int64 `json:"merchant_child_api_id"`
  32. MerchantDataApiId int64 `json:"merchant_data_api_id"`
  33. BaseApiId int64 `json:"base_api_id" description:"基础api id"`
  34. ComboType int `json:"combo_type" description:"套餐类型 1 总次数, 2 按天"`
  35. CountType int `json:"count_type" description:"计数类型,即查 即得"`
  36. CountCode string `json:"count_code" description:"如果即查,返回码为该字段中的一种时需扣次数"`
  37. IsForceUpdate bool `json:"is_force_update" description:"是否强更"`
  38. RequstParamConf []ManagementBaseApiParam `json:"request_param_conf" description:"请求参数"`
  39. ResponseParamConf []ManagementBaseApiParam `json:"response_param_conf" description:"响应参数"`
  40. DecryptParam []byte `json:"descrypt_query_param" description:"解密后的参数"`
  41. AppSecret string `json:"app_secret"`
  42. IsCrypto bool `json:"is_encrypt"`
  43. AccessCountId int64 `json:"access_count_id"`
  44. ReuseTime int `json:"reuse_time"`
  45. ReplaceInfo MerchantReplaceInfo `json:"merchant_replace_info"`
  46. Timeout uint64 `json:"timeout" description:"商户接口超时时间"`
  47. MinimalTimeConsuming int `json:"minimal_time_consuming" description:"最小耗时"`
  48. RandomPercentage int `json:"random_percentage" description:"随机百分比"`
  49. IsRawErrorCode bool `json:"is_raw_error_code" description:"是否返回原始错误码"`
  50. Token RateLimitToken `json:"token"`
  51. // TODO 扣费方式 1 按量 2 按充值金额
  52. FeeType int `json:"fee_type"`
  53. // 单价
  54. UnitPrice float64 `json:"unit_price"`
  55. }
  56. type MerchantReplaceInfo struct {
  57. ReplaceMerchantId int64 `json:"replace_merchant_id"`
  58. ReplaceBaseApiId int64 `json:"replace_base_api_id"`
  59. ReplaceMerchantDataApiId int64 `json:"replace_merchant_data_api_id"`
  60. ReplaceMerchantChildApiId int64 `json:"replace_merchant_child_api_id"`
  61. }
  62. type ManagementCheckApiReply struct {
  63. MerchantApiInfo CheckMerchantApiResult `json:"api_info" description:"校验成功后商户api相关信息"`
  64. ErrCode int `json:"err_code"`
  65. ErrMsg string `json:"err_msg"`
  66. }
  67. type ManagementThirdpartCountIncreaseReq struct {
  68. State bool `json:"state" description:"访问三方状态,false失败,true成功"`
  69. MerchantChildApiId int64 `json:"merchant_child_api_id"`
  70. ProviderApiId int64 `json:"provider_api_id"`
  71. RawCode string `json:"raw_code"`
  72. }
  73. type ManagementThirdpartCountIncreaseReply struct {
  74. }
  75. type ManagementCheckCountCodeReq struct {
  76. AccessCountId int64 `json:"access_count_id"`
  77. CountCode string `json:"count_code"`
  78. Code string `json:"code"`
  79. CountType int `json:"count_type" description:"0 即查 1即得"`
  80. //TODO 扣费方式 1 按量 2 按充值金额
  81. FeeType int `json:"fee_type"`
  82. // 单价
  83. UnitPrice float64 `json:"unit_price"`
  84. MerchantDataApiId int64 `json:"merchant_data_api_id"`
  85. MerchantId int64 `json:"merchant_id"`
  86. }
  87. type ManagementCheckCountCodeReply struct {
  88. }
  89. type MerchantAppLoginReq struct {
  90. User string `json:"user"`
  91. Password string `json:"password"`
  92. }
  93. type MerchantAppLoginReply struct {
  94. MerchantId int64 `json:"merchant_id"`
  95. }