You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.4 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. package v1
  2. import (
  3. "github.com/gogf/gf/v2/frame/g"
  4. "xgit.pub/module/cms/app/model"
  5. "xgit.pub/st52/xcore/dto"
  6. )
  7. // GetTreeReq 获取分类树请求参数
  8. type GetTreeReq struct {
  9. g.Meta `path:"/category/tree" method:"post" summary:"获取树" tags:"分类"`
  10. }
  11. // GetTreeRes 获取分类树返回参数
  12. type GetTreeRes struct {
  13. Data interface{} `json:"data"`
  14. }
  15. // GetListReq 获取分类列表
  16. type GetListReq struct {
  17. g.Meta `path:"/category/list" method:"post" summary:"获取列表" tags:"分类"`
  18. Key string `json:"key"`
  19. dto.PageReq
  20. }
  21. // GetListRes 获取分类列表返回参数
  22. type GetListRes struct {
  23. dto.PageRes
  24. }
  25. // CreateReq 创建分类请求参数
  26. type CreateReq struct {
  27. g.Meta `path:"/category/create" method:"post" summary:"创建" tags:"分类"`
  28. ParentId int `json:"parent_id" description:"父节点"`
  29. Name string `json:"name" description:"分类名字"`
  30. Union string `json:"union" description:"关联"`
  31. Sort int `json:"sort" description:"排序"`
  32. Status int `json:"status" description:"状态"`
  33. SeoTitle string `json:"seo_title" description:""`
  34. SeoKey string `json:"seo_key" description:""`
  35. SeoDes string `json:"seo_des" description:""`
  36. TplIndex string `json:"tpl_index" description:"Index"`
  37. TplList string `json:"tpl_list" description:"GetList"`
  38. TplDetail string `json:"tpl_detail" description:"Detail"`
  39. TplDown string `json:"tpl_down" description:"Down"`
  40. TplPlay string `json:"tpl_play" description:"player"`
  41. model.CategoryExtend
  42. }
  43. // CreateRes 创建分类返回参数
  44. type CreateRes struct {
  45. Id int64 `json:"id"`
  46. }
  47. // UpdateReq 更新分类请求参数
  48. type UpdateReq struct {
  49. g.Meta `path:"/category/update" method:"post" summary:"更新" tags:"分类"`
  50. Id int `json:"id" description:""`
  51. ParentId int `json:"parent_id" description:"父节点"`
  52. Name string `json:"name" description:"分类名字"`
  53. Union string `json:"union" description:"关联"`
  54. Sort int `json:"sort" description:"排序"`
  55. Status int `json:"status" description:"状态"`
  56. SeoTitle string `json:"seo_title" description:""`
  57. SeoKey string `json:"seo_key" description:""`
  58. SeoDes string `json:"seo_des" description:""`
  59. TplIndex string `json:"tpl_index" description:"Index"`
  60. TplList string `json:"tpl_list" description:"GetList"`
  61. TplDetail string `json:"tpl_detail" description:"Detail"`
  62. TplDown string `json:"tpl_down" description:"Down"`
  63. TplPlay string `json:"tpl_play" description:"player"`
  64. model.CategoryExtend
  65. }
  66. // UpdateRes 更新分类返回参数
  67. type UpdateRes struct{}
  68. // DeleteReq 删除分类请求参数
  69. type DeleteReq struct {
  70. g.Meta `path:"/category/delete" method:"post" summary:"删除" tags:"分类"`
  71. Id uint `json:"id"`
  72. }
  73. // DeleteRes 删除分类返回参数
  74. type DeleteRes struct{}
  75. // BatchDeleteReq 批量删除分类请求参数
  76. type BatchDeleteReq struct {
  77. g.Meta `path:"/category/batch/delete" method:"post" summary:"批量删除" tags:"分类"`
  78. Ids []uint `json:"ids"`
  79. }
  80. // BatchDeleteRes 批量删除分类返回参数
  81. type BatchDeleteRes struct{}
  82. // Drop 交换分类
  83. type Drop struct {
  84. g.Meta `path:"/category/drop" method:"post" summary:"交换" tags:"分类"`
  85. Source int `json:"source"`
  86. Target int `json:"target"`
  87. Action string `json:"action"`
  88. }
  89. // DropRes 交换分类返回参数
  90. type DropRes struct{}