category.api 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import "../base.api"
  2. type (
  3. // The data of category information | Category信息
  4. CategoryInfo {
  5. BaseIDInfo
  6. // name | 角色名称
  7. Name *string `json:"name,optional"`
  8. // organization_id | 租户ID
  9. OrganizationId *uint64 `json:"organizationId,optional"`
  10. }
  11. // The response data of category list | Category列表数据
  12. CategoryListResp {
  13. BaseDataInfo
  14. // Category list data | Category列表数据
  15. Data CategoryListInfo `json:"data"`
  16. }
  17. // Category list data | Category列表数据
  18. CategoryListInfo {
  19. BaseListInfo
  20. // The API list data | Category列表数据
  21. Data []CategoryInfo `json:"data"`
  22. }
  23. // Get category list request params | Category列表请求参数
  24. CategoryListReq {
  25. PageInfo
  26. // name | 角色名称
  27. Name *string `json:"name,optional"`
  28. }
  29. // Category information response | Category信息返回体
  30. CategoryInfoResp {
  31. BaseDataInfo
  32. // Category information | Category数据
  33. Data CategoryInfo `json:"data"`
  34. }
  35. )
  36. @server(
  37. jwt: Auth
  38. group: category
  39. middleware: Authority
  40. )
  41. service Wechat {
  42. // Create category information | 创建Category
  43. @handler createCategory
  44. post /category/create (CategoryInfo) returns (BaseMsgResp)
  45. // Update category information | 更新Category
  46. @handler updateCategory
  47. post /category/update (CategoryInfo) returns (BaseMsgResp)
  48. // Delete category information | 删除Category信息
  49. @handler deleteCategory
  50. post /category/delete (IDsReq) returns (BaseMsgResp)
  51. // Get category list | 获取Category列表
  52. @handler getCategoryList
  53. post /category/list (CategoryListReq) returns (CategoryListResp)
  54. // Get category by ID | 通过ID获取Category
  55. @handler getCategoryById
  56. post /category (IDReq) returns (CategoryInfoResp)
  57. }