123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- package dto
- import (
- "cold-delivery/app/admin/model"
- "cold-delivery/common/dto"
- common "cold-delivery/common/model"
- )
- type SysRoleGetPageReq struct {
- dto.Pagination `search:"-"`
- Name string `form:"name" search:"type:contains;column:name;table:sys_role"` // 角色名称
- SysRoleOrder
- }
- type SysRoleOrder struct {
- SortOrder string `form:"sort" search:"type:order;column:sort;table:sys_role" default:"asc"`
- }
- func (m *SysRoleGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type SysRoleInsertReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- Name string `json:"name" example:"管理员"` // 角色名称
- Status string `json:"status" swaggerignore:"true"` // 状态 1-停用 2-正常
- RoleKey string `json:"roleKey" swaggerignore:"true"` // 角色代码
- Sort int `json:"roleSort" example:"0" swaggerignore:"true"` // 角色排序
- DataScope int `json:"dataScope" example:"1" swaggerignore:"true"` // 数据权限 1-全部数据权限 3-本机构数据权限 4-本机构及以下数据权限 5-仅本人数据权限
- Remark string `json:"remark" example:"备注"` // 备注
- MenuIds []int `json:"menuIds"`
- common.DeptBy
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRoleInsertReq) Generate(model *model.SysRole) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Status = "2"
- model.RoleKey = s.RoleKey
- model.Sort = 0
- model.DataScope = 3
- model.Remark = s.Remark
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- if s.DeptBy.DeptId != 0 {
- model.DeptId = s.DeptId
- }
- }
- func (s *SysRoleInsertReq) GetId() interface{} {
- return s.Id
- }
- type SysRoleUpdateReq struct {
- Id int `json:"id" comment:"编码"` // 编码
- Name string `form:"roleName" example:"管理员"` // 角色名称
- Status string `form:"status" example:"2" swaggerignore:"true"` // 状态 1-停用 2-正常
- Sort int `form:"roleSort" example:"0" swaggerignore:"true"` // 角色排序
- DataScope int `form:"dataScope" example:"1" swaggerignore:"true"` // 数据权限 1-全部数据权限 3-本机构数据权限 4-本机构及以下数据权限 5-仅本人数据权限
- Remark string `form:"remark" example:"备注"` // 备注
- MenuIds []int `form:"menuIds"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRoleUpdateReq) Generate(model *model.SysRole) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Status = "2"
- model.Sort = 0
- model.DataScope = 3
- model.Remark = s.Remark
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- func (s *SysRoleUpdateReq) GetId() interface{} {
- return s.Id
- }
- type SysRoleByName struct {
- RoleName string `form:"role"` // 角色编码
- }
- type SysRoleGetReq struct {
- Id int `uri:"id"`
- }
- func (s *SysRoleGetReq) GetId() interface{} {
- return s.Id
- }
- type SysRoleDeleteReq struct {
- Id int `json:"id"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRoleDeleteReq) GetId() interface{} {
- return s.Id
- }
- type DeptIdList struct {
- DeptId int `json:"Id"`
- }
- type SysRoleUpdateRoleApiReq struct {
- Id int `uri:"id" comment:"角色编码" swaggerignore:"true"` // 角色编码
- ServiceId int `json:"serviceId" example:"1"` // 服务id
- ApiIds []int `json:"apiIds" example:"1,2,3"` // api路由 id
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRoleUpdateRoleApiReq) GetId() interface{} {
- return s.Id
- }
- type SysRoleGetRoleApiListReq struct {
- Id int `uri:"id" comment:"角色编码" swaggerignore:"true"` // 角色编码
- ServiceId int `form:"serviceId" example:"1"` // 服务id
- }
- func (s *SysRoleGetRoleApiListReq) GetId() interface{} {
- return s.Id
- }
- type SysRoleUpdateRoleMenuReq struct {
- Id int `uri:"id" comment:"角色编码" swaggerignore:"true"` // 角色编码
- MenuIds []int `json:"menuIds" example:"1,2,3"` // 系统菜单id
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRoleUpdateRoleMenuReq) GetId() interface{} {
- return s.Id
- }
- type SysRoleGetRoleMenuListReq struct {
- Id int `uri:"id" comment:"角色编码" swaggerignore:"true"` // 角色编码
- }
- func (s *SysRoleGetRoleMenuListReq) GetId() interface{} {
- return s.Id
- }
- type SysRoleGetRoleMenuListResp struct {
- MenuIds []int `json:"menuIds"`
- }
|