123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- package dto
- import (
- "Medical_OAuth/app/admin/model"
- "Medical_OAuth/common/dto"
- common "Medical_OAuth/common/model"
- )
- // ServMenuGetPageReq 列表或者搜索使用结构体
- type ServMenuGetPageReq struct {
- dto.Pagination `search:"-"`
- ServiceId int `form:"serviceId" search:"type:exact;column:service_id;table:serv_menu"` // 服务id
- Name string `form:"name" search:"type:contains;column:name;table:serv_menu"` // 菜单名称
- Visible int `form:"visible" search:"type:exact;column:visible;table:serv_menu"` // 显示状态
- ServMenuOrder
- }
- type ServMenuOrder struct {
- SortOrder string `search:"type:order;column:sort;table:serv_menu" form:"sort" default:"asc"` //排序 ASC 升序 DESC 降序
- }
- func (m *ServMenuGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type ServMenuInsertReq struct {
- Id int `uri:"id" swaggerignore:"true"` //编码
- ServiceId int `form:"serviceId" example:"1" vd:"@:$>0; msg:'服务ID不能为空'"` // 服务id
- Name string `form:"name" example:"菜单名称"` //菜单名称
- Icon string `form:"icon" example:"app-group-fill"` //图标
- Path string `form:"path" example:"/admin"` //路径
- MenuPath string `form:"paths" swaggerignore:"true"` //id路径
- MenuType string `form:"menuType" example:"C"` //菜单类型 M-目录 C-菜单 F-按钮
- Permission string `form:"permission" example:"admin:sysUser:list"` //权限编码
- ParentId int `form:"parentId" example:"0"` //上级菜单
- Component string `form:"component" example:"/admin/sys-user/index"` //组件名称
- Sort int `form:"sort" example:"0"` //排序
- Visible string `form:"visible" example:"1"` //是否显示 1-显示 2-隐藏
- IsFrame string `form:"isFrame" example:"0"` //是否frame 1-是 2-否
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *ServMenuInsertReq) Generate(model *model.ServMenu) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.ServiceId = s.ServiceId
- model.Name = s.Name
- model.Icon = s.Icon
- model.Path = s.Path
- model.MenuPath = s.MenuPath
- model.MenuType = s.MenuType
- model.Permission = s.Permission
- model.ParentId = s.ParentId
- model.Component = s.Component
- model.Sort = s.Sort
- model.Visible = s.Visible
- model.IsFrame = s.IsFrame
- if s.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- if s.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- }
- func (s *ServMenuInsertReq) GetId() interface{} {
- return s.Id
- }
- type ServMenuUpdateReq struct {
- Id int `uri:"id" swaggerignore:"true"` //编码
- Name string `form:"name" example:"菜单名称"` //菜单名称
- Icon string `form:"icon" example:"app-group-fill"` //图标
- Path string `form:"path" example:"/admin"` //路径
- MenuPath string `form:"paths" swaggerignore:"true"` //id路径
- MenuType string `form:"menuType" example:"C"` //菜单类型 M-目录 C-菜单 F-按钮
- Permission string `form:"permission" example:"admin:sysUser:list"` //权限编码
- ParentId int `form:"parentId" example:"0"` //上级菜单
- Component string `form:"component" example:"/admin/sys-user/index"` //组件名称
- Sort int `form:"sort" example:"0"` //排序
- Visible string `form:"visible" example:"1"` //是否显示 1-显示 2-隐藏
- IsFrame string `form:"isFrame" example:"0"` //是否frame 1-是 2-否
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *ServMenuUpdateReq) Generate(model *model.ServMenu) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Icon = s.Icon
- model.Path = s.Path
- model.MenuPath = s.MenuPath
- model.MenuType = s.MenuType
- model.Permission = s.Permission
- model.ParentId = s.ParentId
- model.Component = s.Component
- model.Sort = s.Sort
- model.Visible = s.Visible
- model.IsFrame = s.IsFrame
- if s.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- if s.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- }
- func (s *ServMenuUpdateReq) GetId() interface{} {
- return s.Id
- }
- type ServMenuGetReq struct {
- Id int `uri:"id"`
- }
- func (s *ServMenuGetReq) GetId() interface{} {
- return s.Id
- }
- type ServMenuDeleteReq struct {
- Ids []int `json:"ids"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *ServMenuDeleteReq) GetId() interface{} {
- return s.Ids
- }
- type ServMenuLabel struct {
- Id int `json:"id,omitempty" gorm:"-"`
- Label string `json:"label,omitempty" gorm:"-"`
- Children []MenuLabel `json:"children,omitempty" gorm:"-"`
- }
- type ServMenuRole struct {
- model.ServMenu
- IsSelect bool `json:"is_select" gorm:"-"`
- }
- type AppSelectRole struct {
- RoleId int `uri:"roleId"`
- }
- type ServMenuExportReq struct {
- ServiceId int `form:"serviceId" example:"1"`
- Type string `form:"type" example:"json"` // json excel
- }
|