integral.api 5.6 KB

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