integral.api 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. syntax = "v1"
  2. type purchResourcesReq {
  3. AccountId string `form:"accountId"` //账户标识
  4. CompanyId int64 `form:"companyId,optional"` //企业标识
  5. DepartmentId int64 `form:"departmentId,optional"` //组织标识
  6. Name string `form:"name"` //资源名称
  7. ResourceType string `form:"resourceType,optional"` //资源类型
  8. Number int64 `form:"number"` //数量
  9. Spec string `form:"spec,optional"` //规格
  10. AppId string `form:"appId"` //标识
  11. EndTime string `form:"endTime,optional"` //新增时数据包截止时间
  12. VipTime string `form:"vipTime,optional"` //超级订阅时间
  13. Remarks string `form:"remarks,optional"` //备注
  14. }
  15. type useResourcesReq {
  16. AccountId string `form:"accountId"` //账户标识
  17. CompanyId int64 `form:"companyId,optional"` //企业标识
  18. DepartmentId int64 `form:"departmentId,optional"` //组织标识
  19. Name string `form:"name"` //资源名称
  20. ResourceType string `form:"resourceType,optional"` //资源类型
  21. Number int64 `form:"number"` //数量
  22. AppId string `form:"appId"` //标识
  23. RuleId string `form:"ruleId,optional"` //使用规则标识
  24. UserId string `form:"userId"` //用户标识
  25. Remarks string `form:"remarks,optional"` //备注
  26. InfoId string `form:"infoId,optional"` //信息标识
  27. DuplicateRemoval int64 `form:"duplicateRemoval,optional"` //是否去重0不去1去重
  28. }
  29. type resourcesRes {
  30. // TODO: add members here and delete this comment
  31. Code int64 `json:"code"`
  32. Message string `json:"message"`
  33. }
  34. type useUserResponse {
  35. // TODO: add members here and delete this comment
  36. Code int64 `json:"code"`
  37. Message string `json:"message"`
  38. DeductionNumb int64 `json:"deductionNumb"`
  39. }
  40. type previewReq {
  41. InfoId string `form:"infoId,optional"` //信息标识
  42. AccountId string `form:"accountId,optional"` //企业标识
  43. ResourceType string `form:"resourceType,optional"` //资源类型
  44. }
  45. type previewRes {
  46. // TODO: add members here and delete this comment
  47. Code int64 `json:"code"`
  48. Message string `json:"message"`
  49. RepeatNumb int64 `json:"repeatNumb"`
  50. DeductionNumb int64 `json:"deductionNumb"`
  51. }
  52. //流水账请求参数返回参数
  53. type recordReq {
  54. AccountId string `form:"accountId,optional"` //企业标识
  55. UserId string `form:"userId,optional"` //用户标识
  56. Page int64 `form:"page,optional"`
  57. PageSize int64 `form:"pageSize,optional"`
  58. ResourceType string `form:"resourceType,optional"` //资源类型
  59. State int64 `form:"state,optional"` //0查消耗记录 1 查充值记录
  60. QueryTime string `form:"queryTime,optional"` //查询时间
  61. }
  62. type recordRes {
  63. Code int64 `json:"code"`
  64. Message string `json:"message"`
  65. Data []map[string]interface{} `json:"data"`
  66. Count int64 `json:"count"`
  67. }
  68. //查询用户资源权限
  69. type authReq {
  70. AccountId string `form:"accountId,optional"` //企业标识
  71. UserId string `form:"userId,optional"` //用户标识
  72. ResourceType string `form:"resourceType,optional"` //资源类型
  73. }
  74. type authRes {
  75. Code int64 `json:"code"`
  76. Message string `json:"message"`
  77. Data []map[string]interface{} `json:"data"`
  78. }
  79. //账户余额
  80. type balanceReq {
  81. AccountId string `form:"accountId,optional"` //企业标识
  82. UserId string `form:"userId,optional"` //用户标识
  83. ResourceType string `form:"resourceType,optional"` //资源类型
  84. }
  85. type balanceRes {
  86. Code int64 `json:"code"`
  87. Message string `json:"message"`
  88. Data []map[string]interface{} `json:"data"`
  89. }
  90. type mergeInfo {
  91. MergeUser string `form:"mergeUser"` //合并用户
  92. MergedUser string `form:"mergedUser"` //被合并用户
  93. AppId string `form:"appId"` //身份标识
  94. }
  95. service integral-api {
  96. //资源使用
  97. @handler UseUserDetailedHandler // TODO: set handler name and delete this comment
  98. post /resources/useUserDetailed (useResourcesReq) returns(resourcesRes)
  99. //购买资源
  100. @handler PurchaseUserBalanceHandler // TODO: set handler name and delete this comment
  101. post /resources/purchaseUserBalance (purchResourcesReq) returns(useUserResponse)
  102. //预览信息
  103. @handler FindPreviewHandler // TODO: set handler name and delete this comment
  104. post /resources/findPreview (previewReq) returns(previewRes)
  105. //流水账
  106. @handler FindRecordHandler // TODO: set handler name and delete this comment
  107. post /resources/findRecord (recordReq) returns(recordRes)
  108. //查询账户资源权限
  109. @handler FindAuthHandler // TODO: set handler name and delete this comment
  110. post /resources/findAuth (authReq) returns(recordRes)
  111. //查询账户余额
  112. @handler FindBalanceHandler // TODO: set handler name and delete this comment
  113. post /resources/findBalance (balanceReq) returns(balanceRes)
  114. //账号合并
  115. @handler UserMergeHandler // TODO: set handler name and delete this comment
  116. post /resources/userMerge (mergeInfo) returns(resourcesRes)
  117. }