package dto import ( "Medical_OAuth/app/admin/model" "Medical_OAuth/common/dto" common "Medical_OAuth/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 `uri:"id" swaggerignore:"true" swaggerignore:"true"` // 角色编码 Name string `form:"roleName" example:"管理员"` // 角色名称 Status string `form:"status" example:"2"` // 状态 1-停用 2-正常 RoleKey string `form:"roleKey" swaggerignore:"true"` // 角色代码 Sort int `form:"roleSort" example:"0"` // 角色排序 DataScope int `form:"dataScope" example:"1"` // 数据权限 1-全部数据权限 3-本机构数据权限 4-本机构及以下数据权限 5-仅本人数据权限 Remark string `form:"remark" example:"备注"` // 备注 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 = s.Status model.RoleKey = s.RoleKey model.Sort = s.Sort model.DataScope = s.DataScope model.Remark = s.Remark if s.ControlBy.UpdateBy != 0 { model.UpdateBy = s.UpdateBy } if s.ControlBy.CreateBy != 0 { model.CreateBy = s.CreateBy } } func (s *SysRoleInsertReq) GetId() interface{} { return s.Id } type SysRoleUpdateReq struct { Id int `uri:"id" comment:"角色编码" swaggerignore:"true"` // 角色编码 Name string `form:"roleName" example:"管理员"` // 角色名称 Status string `form:"status" example:"2"` // 状态 1-停用 2-正常 Sort int `form:"roleSort" example:"0"` // 角色排序 DataScope int `form:"dataScope" example:"1"` // 数据权限 1-全部数据权限 3-本机构数据权限 4-本机构及以下数据权限 5-仅本人数据权限 Remark string `form:"remark" example:"备注"` // 备注 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 = s.Status model.Sort = s.Sort model.DataScope = s.DataScope 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 SysRoleGetRoleApiListResp struct { ApiList []model.ServApi `json:"apiList"` ApiIds []int `json:"apiIds"` } 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"` }