credit_balance.api 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import "../base.api"
  2. type (
  3. // The data of credit balance information | CreditBalance信息
  4. CreditBalanceInfo {
  5. BaseIDInfo
  6. // user_id | 用户ID
  7. UserId *string `json:"userId,optional"`
  8. // role | 角色设定
  9. Balance *float32 `json:"balance,optional"`
  10. // status | 状态 1-正常 2-禁用
  11. Status *int `json:"status,optional"`
  12. // organization_id | 租户ID
  13. OrganizationId *uint64 `json:"organizationId,optional"`
  14. User BUserInfo `json:"user,optional"`
  15. }
  16. BUserInfo {
  17. UserId *string `json:"userId,optional"`
  18. // User's name | 用户名
  19. Username *string `json:"username,optional"`
  20. // User's nickname | 用户的昵称
  21. Nickname *string `json:"nickname,optional"`
  22. // The user's avatar path | 用户的头像路径
  23. Avatar *string `json:"avatar,optional"`
  24. }
  25. // The response data of credit balance list | CreditBalance列表数据
  26. CreditBalanceListResp {
  27. BaseDataInfo
  28. // CreditBalance list data | CreditBalance列表数据
  29. Data CreditBalanceListInfo `json:"data"`
  30. }
  31. // CreditBalance list data | CreditBalance列表数据
  32. CreditBalanceListInfo {
  33. BaseListInfo
  34. // The API list data | CreditBalance列表数据
  35. Data []CreditBalanceInfo `json:"data"`
  36. }
  37. // Get credit balance list request params | CreditBalance列表请求参数
  38. CreditBalanceListReq {
  39. PageInfo
  40. // user_id | 用户ID
  41. UserId *string `json:"userId,optional"`
  42. OrganizationId *uint64 `json:"organizationId,optional"`
  43. }
  44. // CreditBalance information response | CreditBalance信息返回体
  45. CreditBalanceInfoResp {
  46. BaseDataInfo
  47. // CreditBalance information | CreditBalance数据
  48. Data CreditBalanceInfo `json:"data"`
  49. }
  50. CreditBalanceOperateReq {
  51. UserId *string `json:"userId,optional"`
  52. Number *float32 `json:"number,optional"`
  53. Reason *string `json:"reason,optional"`
  54. }
  55. )
  56. @server(
  57. jwt: Auth
  58. group: credit_balance
  59. middleware: Authority
  60. )
  61. service Wechat {
  62. // Create credit balance information | 创建CreditBalance
  63. @handler createCreditBalance
  64. post /credit_balance/create (CreditBalanceInfo) returns (BaseMsgResp)
  65. // Update credit balance information | 更新CreditBalance
  66. @handler updateCreditBalance
  67. post /credit_balance/update (CreditBalanceInfo) returns (BaseMsgResp)
  68. // Delete credit balance information | 删除CreditBalance信息
  69. @handler deleteCreditBalance
  70. post /credit_balance/delete (IDsReq) returns (BaseMsgResp)
  71. // Get credit balance list | 获取CreditBalance列表
  72. @handler getCreditBalanceList
  73. post /credit_balance/list (CreditBalanceListReq) returns (CreditBalanceListResp)
  74. // Get credit balance by ID | 通过ID获取CreditBalance
  75. @handler getCreditBalanceById
  76. post /credit_balance (IDReq) returns (CreditBalanceInfoResp)
  77. // Get credit balance by ID | 通过ID获取CreditBalance
  78. @handler operateCreditBalance
  79. post /credit_balance/operate (CreditBalanceOperateReq) returns (BaseMsgResp)
  80. }