| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- package dto
- import (
- "Medical_OAuth/app/admin/model"
- "Medical_OAuth/common/dto"
- common "Medical_OAuth/common/model"
- )
- // SysRegisterAuthPageReq 列表或者搜索使用结构体
- type SysRegisterAuthPageReq struct {
- dto.Pagination `search:"-"`
- URKey string `form:"URKey" search:"type:contains;column:ur_key;table:sys_register_auth"` // 名称
- Status int `form:"status" search:"type:exact;column:status;table:sys_register_auth"` // 状态
- }
- func (m *SysRegisterAuthPageReq) GetNeedSearch() interface{} {
- return *m
- }
- // SysRegisterAuthInsertReq 增使用的结构体
- type SysRegisterAuthInsertReq struct {
- Id int `json:"id" swaggerignore:"true"`
- URKey string `swaggerignore:"true"`
- RoleId int `json:"roleId" vd:"$>0" example:"2"` //角色id
- DeptId int `json:"deptId" vd:"$>0" example:"2"` // 部门id
- Status int `json:"status" vd:"$>0" example:"2"` // 状态 1-停用 2-正常
- SMSVerify int `json:"SMSVerify" vd:"$>0" example:"2"` // 短信验证 1-关闭 2-开启
- InviteCode string `json:"inviteCode" example:"HnhsqMls"` // 邀请码,可以为空
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRegisterAuthInsertReq) Generate(model *model.SysRegisterAuth) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- if len(s.URKey) > 0 {
- model.URKey = s.URKey
- }
- model.RoleId = s.RoleId
- model.DeptId = s.DeptId
- model.Status = s.Status
- model.SMSVerify = s.SMSVerify
- model.InviteCode = s.InviteCode
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- // GetId 获取数据对应的ID
- func (s *SysRegisterAuthInsertReq) GetId() interface{} {
- return s.Id
- }
- // SysRegisterAuthUpdateReq 改使用的结构体
- type SysRegisterAuthUpdateReq struct {
- Id int `uri:"id" swaggerignore:"true"`
- RoleId int `json:"roleId" vd:"$>0" example:"2"` //角色id
- DeptId int `json:"deptId" vd:"$>0" example:"2"` // 部门id
- Status int `json:"status" vd:"$>0" example:"2"` // 状态 1-停用 2-正常
- SMSVerify int `json:"SMSVerify" vd:"$>0" example:"2"` // 短信验证 1-关闭 2-开启
- InviteCode string `json:"inviteCode" example:"HnhsqMls"` // 邀请码,可以为空
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRegisterAuthUpdateReq) Generate(model *model.SysRegisterAuth) {
- model.Id = s.Id
- model.RoleId = s.RoleId
- model.DeptId = s.DeptId
- model.Status = s.Status
- model.SMSVerify = s.SMSVerify
- model.InviteCode = s.InviteCode
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- func (s *SysRegisterAuthUpdateReq) GetId() interface{} {
- return s.Id
- }
- // SysRegisterAuthGetReq 获取单个的结构体
- type SysRegisterAuthGetReq struct {
- Id int `uri:"id"`
- }
- func (s *SysRegisterAuthGetReq) GetId() interface{} {
- return s.Id
- }
- // SysRegisterAuthDeleteReq 删除的结构体
- type SysRegisterAuthDeleteReq struct {
- Id int `json:"id"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *SysRegisterAuthDeleteReq) Generate(model *model.SysRegisterAuth) {
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- func (s *SysRegisterAuthDeleteReq) GetId() interface{} {
- return s.Id
- }
|