integral.api 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. syntax = "v1"
  2. type resourcesReq {
  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"` //资源类型
  8. Number int64 `form:"number"` //数量
  9. Spec string `form:"spec,optional"` //规格
  10. AppId string `form:"appId"` //标识
  11. Model int64 `form:"model"` //操作类型0使用1新增
  12. RuleId string `form:"ruleId,optional"` //使用规则标识
  13. UserId string `form:"userId"` //用户标识
  14. Url string `form:"url,optional"` //下载地址
  15. SearchCriteria string `form:"searchCriteria,optional"` //搜索条件
  16. Source string `form:"source,optional"` //数据来源
  17. StartTime string `form:"startTime,optional"` //新增时数据包开始时间
  18. EndTime string `form:"endTime,optional"` //新增时数据包截止时间
  19. InfoId string `form:"infoId,optional"` //信息标识
  20. DuplicateRemoval int64 `form:"duplicateRemoval,optional"` //是否去重0不去1去重
  21. }
  22. type resourcesRes {
  23. // TODO: add members here and delete this comment
  24. Code int64 `form:"code"`
  25. Message string `form:"message"`
  26. }
  27. type previewReq {
  28. InfoId string `form:"infoId,optional"` //信息标识
  29. AccountId string `form:"accountId,optional"` //企业标识
  30. DeductionType string `form:"deductionType,optional"` //资源代码
  31. }
  32. type previewRes {
  33. // TODO: add members here and delete this comment
  34. Code int64 `form:"code"`
  35. Message string `form:"message"`
  36. RepeatNumb int64 `form:"repeatNumb"`
  37. DeductionNumb int64 `form:"deductionNumb"`
  38. }
  39. //流水账请求参数返回参数
  40. type recordReq {
  41. AccountId string `form:"accountId,optional"` //企业标识
  42. UserId string `form:"userId,optional"` //用户标识
  43. Page int `form:"page,optional"`
  44. PageSize int `form:"pageSize,optional"`
  45. }
  46. type recordRes {
  47. Code int64 `json:"code"`
  48. Message string `json:"message"`
  49. Data []map[string]interface{} `json:"data"`
  50. Count int64 `json:"count"`
  51. }
  52. //查询用户资源权限
  53. type authReq {
  54. AccountId string `form:"accountId,optional"` //企业标识
  55. UserId string `form:"userId,optional"` //用户标识
  56. }
  57. type authRes {
  58. Code int64 `json:"code"`
  59. Message string `json:"message"`
  60. Data []map[string]interface{} `json:"data"`
  61. }
  62. //账户余额
  63. type balanceReq {
  64. AccountId string `form:"accountId,optional"` //企业标识
  65. UserId string `form:"userId,optional"` //用户标识
  66. }
  67. type balanceRes {
  68. Code int64 `json:"code"`
  69. Message string `json:"message"`
  70. Data []map[string]interface{} `json:"data"`
  71. }
  72. service integral-api {
  73. //资源操作
  74. @handler UpdateUserBalanceHandler // TODO: set handler name and delete this comment
  75. post /resources/updateUserBalance (resourcesReq) returns(resourcesRes)
  76. //预览信息
  77. @handler FindPreviewHandler // TODO: set handler name and delete this comment
  78. post /findPreview (previewReq) returns(previewRes)
  79. //流水账
  80. @handler FindRecordHandler // TODO: set handler name and delete this comment
  81. post /findRecord (recordReq) returns(recordRes)
  82. //查询账户资源权限
  83. @handler FindAuthHandler // TODO: set handler name and delete this comment
  84. post /findAuth (authReq) returns(recordRes)
  85. //查询账户余额
  86. @handler FindBalanceHandler // TODO: set handler name and delete this comment
  87. post /findBalance (balanceReq) returns(balanceRes)
  88. }