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.

103 lines
3.4 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 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. // UpdateReq 更新分类请求参数
  46. type UpdateReq struct {
  47. g.Meta `path:"/category/update" method:"post" summary:"更新" tags:"分类"`
  48. Id int `json:"id" description:""`
  49. ParentId int `json:"parent_id" description:"父节点"`
  50. Name string `json:"name" description:"分类名字"`
  51. Union string `json:"union" description:"关联"`
  52. Sort int `json:"sort" description:"排序"`
  53. Status int `json:"status" description:"状态"`
  54. SeoTitle string `json:"seo_title" description:""`
  55. SeoKey string `json:"seo_key" description:""`
  56. SeoDes string `json:"seo_des" description:""`
  57. TplIndex string `json:"tpl_index" description:"Index"`
  58. TplList string `json:"tpl_list" description:"GetList"`
  59. TplDetail string `json:"tpl_detail" description:"Detail"`
  60. TplDown string `json:"tpl_down" description:"Down"`
  61. TplPlay string `json:"tpl_play" description:"player"`
  62. model.CategoryExtend
  63. }
  64. // UpdateRes 更新分类返回参数
  65. type UpdateRes struct{}
  66. // DeleteReq 删除分类请求参数
  67. type DeleteReq struct {
  68. g.Meta `path:"/category/delete" method:"post" summary:"删除" tags:"分类"`
  69. Id uint `json:"id"`
  70. }
  71. // DeleteRes 删除分类返回参数
  72. type DeleteRes struct{}
  73. // BatchDeleteReq 批量删除分类请求参数
  74. type BatchDeleteReq struct {
  75. g.Meta `path:"/category/batch/delete" method:"post" summary:"批量删除" tags:"分类"`
  76. Ids []uint `json:"ids"`
  77. }
  78. // BatchDeleteRes 批量删除分类返回参数
  79. type BatchDeleteRes struct{}
  80. // Drop 交换分类
  81. type Drop struct {
  82. g.Meta `path:"/category/drop" method:"post" summary:"交换" tags:"分类"`
  83. Source int `json:"source"`
  84. Target int `json:"target"`
  85. Action string `json:"action"`
  86. }
  87. // DropRes 交换分类返回参数
  88. type DropRes struct{}