123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- package dto
- import (
- "Medical_OAuth/app/admin/model"
- dto2 "Medical_OAuth/common/dto"
- model2 "Medical_OAuth/common/model"
- )
- type SysUserGetPageReq struct {
- dto2.Pagination `search:"-"`
- Username string `form:"username" search:"type:contains;column:username;table:sys_user" comment:"用户名"`
- NickName string `form:"nickName" search:"type:contains;column:nick_name;table:sys_user" comment:"昵称"`
- RoleId int `form:"roleId" search:"type:exact;column:role_id;table:sys_user" comment:"角色ID"`
- DeptId int `form:"deptId" search:"type:exact;column:dept_id;table:sys_user" comment:"部门ID"`
- PostId int `form:"postId" search:"type:exact;column:post_id;table:sys_user" comment:"岗位ID"`
- Status string `form:"status" search:"type:exact;column:status;table:sys_user" comment:"状态"`
- SysUserOrder
- }
- type SysUserOrder struct {
- //UserIdOrder string `search:"type:order;column:id;table:sys_user" form:"userIdOrder"`
- //UsernameOrder string `search:"type:order;column:username;table:sys_user" form:"usernameOrder"`
- //StatusOrder string `search:"type:order;column:status;table:sys_user" form:"statusOrder"`
- CreatedAtOrder string `search:"type:order;column:created_at;table:sys_user" form:"createdAtOrder" default:"desc"`
- }
- func (m *SysUserGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type SysUserGetCountReq struct {
- RoleIds []int `form:"roleId" search:"type:in;column:role_id;table:sys_user" comment:"角色ID"`
- DeptIds []int `form:"deptId" search:"type:in;column:dept_id;table:sys_user" comment:"部门ID"`
- PostIds []int `form:"postId" search:"type:in;column:post_id;table:sys_user" comment:"岗位ID"`
- }
- func (m *SysUserGetCountReq) GetNeedSearch() interface{} {
- return *m
- }
- type ResetSysUserPwdReq struct {
- Id int `json:"id" example:"1" vd:"$>0"` // 用户ID
- Password string `json:"password" example:"123456" vd:"len($)>0"` // 密码
- model2.ControlBy `swaggerignore:"true"`
- }
- func (s *ResetSysUserPwdReq) GetId() interface{} {
- return s.Id
- }
- func (s *ResetSysUserPwdReq) Generate(userModel *model.SysUser) {
- if s.Id != 0 {
- userModel.Id = s.Id
- }
- userModel.Password = s.Password
- if s.ControlBy.UpdateBy != 0 {
- userModel.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- userModel.CreateBy = s.CreateBy
- }
- }
- type UpdateSysUserStatusReq struct {
- Id int `json:"id" example:"1" vd:"$>0"` // 用户ID
- Status string `json:"status" example:"2" vd:"len($)>0"` // 状态 1-停用 2-正常
- model2.ControlBy `swaggerignore:"true"`
- }
- func (s *UpdateSysUserStatusReq) GetId() interface{} {
- return s.Id
- }
- func (s *UpdateSysUserStatusReq) Generate(userModel *model.SysUser) {
- if s.Id != 0 {
- userModel.Id = s.Id
- }
- userModel.Status = s.Status
- if s.ControlBy.UpdateBy != 0 {
- userModel.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- userModel.CreateBy = s.CreateBy
- }
- }
- type SysUserInsertReq struct {
- Id int `json:"id" swaggerignore:"true" comment:"用户ID"` // 用户ID
- Username string `json:"username" example:"username" vd:"@:len($)>0 msg:'用户名不能为空'"` //用户名
- Password string `json:"password" example:"123456" vd:"@:len($)>5 msg:'密码格式不正确'"` //密码
- NickName string `json:"nickName" example:"姓名"` //姓名
- Phone string `json:"phone" example:"13912345678" swaggerignore:"true"` //手机号
- RoleId int `json:"roleId" example:"1" swaggerignore:"true" ` //角色id
- DeptId int `json:"deptId" example:"1" swaggerignore:"true"` //部门id
- PostId int `json:"postId" example:"1" swaggerignore:"true"` //岗位id
- Remark string `json:"remark" example:"备注" swaggerignore:"true"` // 备注
- Status string `json:"status" example:"2" swaggerignore:"true"` // 状态
- model2.ControlBy `swaggerignore:"true"`
- }
- func (s *SysUserInsertReq) Generate(userModel *model.SysUser) {
- if s.Id != 0 {
- userModel.Id = s.Id
- }
- userModel.Username = s.Username
- userModel.Password = s.Password
- userModel.NickName = s.NickName
- userModel.Phone = s.Phone
- userModel.RoleId = s.RoleId
- userModel.DeptId = s.DeptId
- userModel.Remark = s.Remark
- userModel.Status = s.Status
- if s.ControlBy.UpdateBy != 0 {
- userModel.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- userModel.CreateBy = s.CreateBy
- }
- }
- func (s *SysUserInsertReq) GetId() interface{} {
- return s.Id
- }
- type SysUserUpdateReq struct {
- Id int `json:"id"` // 用户id
- NickName string `json:"nickName" example:"昵称"` // 昵称
- Phone string `json:"phone" example:"13988888888" swaggerignore:"true"` // 手机号
- RoleId int `json:"roleId" example:"1" swaggerignore:"true"` //角色id
- DeptId int `json:"deptId" example:"1" swaggerignore:"true"` //部门id
- PostId int `json:"postId" example:"1" swaggerignore:"true"` //岗位id
- Remark string `json:"remark" example:"备注" swaggerignore:"true"` // 备注
- Status string `json:"status" example:"2" swaggerignore:"true"` // 状态
- model2.ControlBy `swaggerignore:"true"`
- }
- func (s *SysUserUpdateReq) Generate(userModel *model.SysUser) {
- if s.Id != 0 {
- userModel.Id = s.Id
- }
- userModel.NickName = s.NickName
- userModel.Phone = s.Phone
- userModel.RoleId = s.RoleId
- userModel.DeptId = s.DeptId
- userModel.Remark = s.Remark
- userModel.Status = s.Status
- if s.ControlBy.UpdateBy != 0 {
- userModel.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- userModel.CreateBy = s.CreateBy
- }
- }
- func (s *SysUserUpdateReq) GetId() interface{} {
- return s.Id
- }
- type SysUserGetReq struct {
- Id int `uri:"id"`
- }
- func (s *SysUserGetReq) GetId() interface{} {
- return s.Id
- }
- type SysUserDeleteReq struct {
- Id int `json:"id"`
- model2.ControlBy `swaggerignore:"true"`
- }
- func (s *SysUserDeleteReq) GetId() interface{} {
- return s.Id
- }
- type SysUserById struct {
- dto2.ObjectById
- model2.ControlBy `swaggerignore:"true"`
- }
- func (s *SysUserById) GetIds() interface{} {
- return s.Ids
- }
- func (s *SysUserById) GetId() interface{} {
- if len(s.Ids) > 0 {
- s.Ids = append(s.Ids, s.Id)
- return s.Ids
- }
- return s.Id
- }
- func (s *SysUserById) GenerateM() (model2.ActiveRecord, error) {
- return &model.SysUser{}, nil
- }
- // PassWord 密码
- type PassWord struct {
- NewPassword string `json:"newPassword" example:"123456" vd:"len($)>0"` // 新密码
- OldPassword string `json:"oldPassword" example:"12345678" vd:"len($)>0"` // 旧密码
- }
- type SysUserRegisterReq struct {
- Id int `json:"id" swaggerignore:"true" comment:"用户ID"` // 用户ID
- URKey string `json:"URKey" example:"jKEnYWNXyrOvTofU" vd:"@:len($)>0 msg:'注册码不能为空'"` //注册码
- Username string `json:"username" example:"username" vd:"@:len($)>0 msg:'用户名不能为空'"` //用户名
- Password string `json:"password" example:"123456" vd:"@:len($)>5 msg:'密码格式不正确'"` //密码
- NickName string `json:"nickName" swaggerignore:"true"` //昵称
- Phone string `json:"phone" example:"13912345678"` //手机号
- Code string `json:"code" example:"125478"` //短信验证码
- RoleId int `json:"roleId" swaggerignore:"true"` //角色id
- DeptId int `json:"deptId" swaggerignore:"true"` //部门id
- PostId int `json:"postId" swaggerignore:"true"` //岗位id
- Remark string `json:"remark" swaggerignore:"true"` // 备注
- Status string `json:"status" swaggerignore:"true"` // 状态
- model2.ControlBy `swaggerignore:"true"`
- }
- func (s *SysUserRegisterReq) Generate(userModel *model.SysUser) {
- if s.Id != 0 {
- userModel.Id = s.Id
- }
- userModel.Username = s.Username
- userModel.Password = s.Password
- userModel.NickName = s.NickName
- userModel.Phone = s.Phone
- userModel.RoleId = s.RoleId
- userModel.DeptId = s.DeptId
- userModel.Remark = s.Remark
- userModel.Status = s.Status
- if s.ControlBy.UpdateBy != 0 {
- userModel.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- userModel.CreateBy = s.CreateBy
- }
- }
- func (s *SysUserRegisterReq) GetId() interface{} {
- return s.Id
- }
- type SysUserGetSMSVerifyCodeReq struct {
- Phone string `form:"phone" example:"13912345678"` //手机号
- }
- type GetNewestTokenReq struct {
- UserId int64 `uri:"userId" example:"1"` //手机号
- }
|