sys_role.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * @desc:角色api
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu<yxh669@qq.com>
  5. * @Date: 2022/3/30 9:16
  6. */
  7. package system
  8. import (
  9. "github.com/gogf/gf/v2/frame/g"
  10. commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
  11. "github.com/tiger1103/gfast/v3/internal/app/system/model"
  12. "github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
  13. )
  14. type RoleListReq struct {
  15. g.Meta `path:"/role/list" tags:"角色管理" method:"get" summary:"角色列表"`
  16. RoleName string `p:"roleName"` //参数名称
  17. Status string `p:"roleStatus"` //状态
  18. commonApi.PageReq
  19. }
  20. type RoleListRes struct {
  21. g.Meta `mime:"application/json"`
  22. commonApi.ListRes
  23. List []*entity.SysRole `json:"list"`
  24. }
  25. type RoleGetParamsReq struct {
  26. g.Meta `path:"/role/getParams" tags:"角色管理" method:"get" summary:"角色编辑参数"`
  27. }
  28. type RoleGetParamsRes struct {
  29. g.Meta `mime:"application/json"`
  30. Menu []*model.SysAuthRuleInfoRes `json:"menu"`
  31. }
  32. type RoleAddReq struct {
  33. g.Meta `path:"/role/add" tags:"角色管理" method:"post" summary:"添加角色"`
  34. Name string `p:"name" v:"required#角色名称不能为空"`
  35. Status uint `p:"status" `
  36. ListOrder uint `p:"listOrder" `
  37. Remark string `p:"remark" `
  38. MenuIds []uint `p:"menuIds"`
  39. }
  40. type RoleAddRes struct {
  41. }
  42. type RoleGetReq struct {
  43. g.Meta `path:"/role/get" tags:"角色管理" method:"get" summary:"获取角色信息"`
  44. Id uint `p:"id" v:"required#角色id不能为空""`
  45. }
  46. type RoleGetRes struct {
  47. g.Meta `mime:"application/json"`
  48. Role *entity.SysRole `json:"role"`
  49. MenuIds []int `json:"menuIds"`
  50. }
  51. type RoleEditReq struct {
  52. g.Meta `path:"/role/edit" tags:"角色管理" method:"put" summary:"修改角色"`
  53. Id int64 `p:"id" v:"required#角色id必须"`
  54. Name string `p:"name" v:"required#角色名称不能为空"`
  55. Status uint `p:"status" `
  56. ListOrder uint `p:"listOrder" `
  57. Remark string `p:"remark" `
  58. MenuIds []uint `p:"menuIds"`
  59. }
  60. type RoleEditRes struct {
  61. }
  62. type RoleDeleteReq struct {
  63. g.Meta `path:"/role/delete" tags:"角色管理" method:"delete" summary:"删除角色"`
  64. Ids []int64 `p:"ids" v:"required#角色id不能为空"`
  65. }
  66. type RoleDeleteRes struct {
  67. }