| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- package dto
- import (
- "cold-delivery/app/admin/model"
- "cold-delivery/common/dto"
- common "cold-delivery/common/model"
- )
- // SysPostGetPageReq 分页查询岗位请求
- type SysPostGetPageReq struct {
- dto.Pagination `search:"-"`
- PostName string `form:"postName" search:"type:contains;column:post_name;table:sys_post"` // 岗位名称
- PostCode string `form:"postCode" search:"type:contains;column:post_code;table:sys_post"` // 岗位编码
- Status string `form:"status" search:"type:exact;column:status;table:sys_post"` // 状态
- DeptId int `form:"deptId" search:"type:exact;column:dept_id;table:sys_post"` // 部门ID
- SysPostOrder
- }
- type SysPostOrder struct {
- SortOrder string `form:"sort" search:"type:order;column:sort;table:sys_post" default:"asc"`
- }
- func (m *SysPostGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- // SysPostInsertReq 新增岗位请求
- type SysPostInsertReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"`
- PostName string `json:"postName"` // 岗位名称
- PostCode string `json:"postCode"` // 岗位编码
- Sort int `json:"sort"` // 排序
- Status string `json:"status"` // 状态 1停用 2正常
- Remark string `json:"remark"` // 备注
- MenuIds []int `json:"menuIds"` // 菜单权限ID列表
- common.DeptBy
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysPostInsertReq) Generate(model *model.SysPost) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.PostName = s.PostName
- model.PostCode = s.PostCode
- model.Sort = s.Sort
- model.Status = s.Status
- model.Remark = s.Remark
- if model.Status == "" {
- model.Status = "2"
- }
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- model.DeptId = s.DeptId
- }
- func (s *SysPostInsertReq) GetId() interface{} {
- return s.Id
- }
- // SysPostUpdateReq 修改岗位请求
- type SysPostUpdateReq struct {
- Id int `json:"id" comment:"编码"` // 编码
- PostName string `json:"postName"` // 岗位名称
- PostCode string `json:"postCode"` // 岗位编码
- DeptId int `json:"deptId"` // 部门ID(支持修改部门)
- Sort int `json:"sort"` // 排序
- Status string `json:"status"` // 状态 1停用 2正常
- Remark string `json:"remark"` // 备注
- MenuIds []int `json:"menuIds"` // 菜单权限ID列表
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysPostUpdateReq) Generate(model *model.SysPost) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.PostName = s.PostName
- model.PostCode = s.PostCode
- model.Sort = s.Sort
- model.Status = s.Status
- model.Remark = s.Remark
- if model.Status == "" {
- model.Status = "2"
- }
- if s.DeptId != 0 {
- model.DeptId = s.DeptId
- }
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- func (s *SysPostUpdateReq) GetId() interface{} {
- return s.Id
- }
- // SysPostGetReq 查询单个岗位请求
- type SysPostGetReq struct {
- Id int `uri:"id"`
- }
- func (s *SysPostGetReq) GetId() interface{} {
- return s.Id
- }
- // SysPostDeleteReq 删除岗位请求
- type SysPostDeleteReq struct {
- Id int `json:"id"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysPostDeleteReq) GetId() interface{} {
- return s.Id
- }
- // SysPostMenuTreeResp 菜单树响应
- type SysPostMenuTreeResp struct {
- List []SysPostMenuLabel `json:"list"`
- }
- // SysPostMenuLabel 菜单树节点
- type SysPostMenuLabel struct {
- Id int `json:"id"`
- Label string `json:"label"`
- ParentId int `json:"parentId"`
- MenuType string `json:"menuType"`
- Children []SysPostMenuLabel `json:"children,omitempty"`
- }
- // SysPostMenuIdsResp 岗位已分配的菜单ID列表
- type SysPostMenuIdsResp struct {
- MenuIds []int `json:"menuIds"`
- }
|