// ========================================================================== // This is auto-generated by gf cli tool. Fill this file as you wish. // ========================================================================== package model import ( "dashoo.cn/micro/app/model/internal" "dashoo.cn/opms_libary/request" ) // SysUser is the golang structure for table sys_user. type SysUser internal.SysUser // Fill with you ideas below. // LoginParamsReq 登陆参数 type LoginParamsReq struct { Username string `p:"username" v:"required#用户名不能为空"` Password string `p:"password" v:"required#密码不能为空"` VerifyCode string `p:"verifyCode" v:"required#验证码不能为空"` VerifyKey string `p:"verifyKey"` } // LoginUserRes 登录返回 type LoginUserRes struct { Id int `orm:"id,primary" json:"id"` // UserName string `orm:"user_name,unique" json:"userName"` // 用户名 UserNickname string `orm:"user_nickname" json:"userNickname"` // 用户昵称 UserPassword string `orm:"user_password" json:"userPassword"` // 登录密码;cmf_password加密 UserSalt string `orm:"user_salt" json:"userSalt"` // 加密盐 UserStatus string `orm:"user_status" json:"userStatus"` // 用户状态;0:禁用,1:正常,2:未验证 Avatar string `orm:"avatar" json:"avatar"` //头像 DeptId int `orm:"dept_id" json:"deptId"` //部门id } // SysUserSearchReq 用户搜索请求参数 type SysUserSearchReq struct { KeyWords string `json:"keyWords"` DeptId int `json:"deptId"` //部门id DeptIds []int //所属部门id数据 Phone string `json:"phone"` Status string `json:"status"` Roles []string `json:"roles"` Posts []string `json:"posts"` Groups []string `json:"groups"` request.PageReq } // SetUserReq 添加修改用户公用请求字段 type SetUserReq struct { DeptId int `p:"deptId" v:"required#用户部门不能为空"` //所属部门 NickName string `p:"nickName" v:"required#用户昵称不能为空"` Email string `p:"email" v:"email#邮箱格式错误"` //邮箱 Phone string `p:"phone" v:"required|phone#手机号不能为空|手机号格式错误"` Sex string `p:"sex" v:"in:10,20,30#状态只能为10、20、30"` Status string `p:"status" v:"required|in:10,20#状态不能为空|状态只能为10或20"` Remark string `p:"remark"` IsAdmin int `p:"isAdmin"` // 是否后台管理员 1 是 0 否 RoleIds []int `p:"roleIds"` PostIds []int `p:"postIds"` GroupIds []int `p:"groupIds"` } // AddUserReq 添加用户参数 type AddUserReq struct { SetUserReq UserName string `p:"userName" v:"required#用户账号不能为空"` Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头,只能包含字母、数字和下划线,长度在6~18之间"` } type EditUserReq struct { SetUserReq Id int `p:"id" v:"required#用户id不能为空"` } type SysUserRoleDeptRes struct { *SysUser Dept *SysDept `json:"dept"` RoleInfo []*struct { RoleId int `json:"roleId"` Name string `json:"name"` } `json:"roleInfo"` Post []*struct { PostId int `json:"postId"` PostName string `json:"postName"` } `json:"post"` } // SysUserResetPwdReq 重置用户密码状态参数 type SysUserResetPwdReq struct { Id int `p:"userId" v:"required#用户id不能为空"` Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头,只能包含字母、数字和下划线,长度在6~18之间"` } // SysUserStatusReq 设置用户状态参数 type SysUserStatusReq struct { Id int `p:"userId" v:"required#用户id不能为空"` UserStatus int `p:"status" v:"required#用户状态不能为空"` } // ProfileUpReq 个人中心修改用户信息参数 type ProfileUpReq struct { UserId int UserNickname string `p:"userNickname" v:"required#用户昵称不能为空" orm:"user_nickname"` // 用户昵称 Mobile string `p:"mobile" v:"required|phone#手机号不能为空|手机号格式错误" orm:"mobile,unique"` UserEmail string `p:"userEmail" v:"email#邮箱格式错误" orm:"user_email"` Sex int `p:"sex" orm:"sex"` } // ProfileUpdatePwdReq 个人中心修改用户密码 type ProfileUpdatePwdReq struct { UserId int OldPassword string `p:"oldPassword" v:"required#旧密码不能为空"` NewPassword string `p:"newPassword" v:"required#新密码不能为空"` } // SysUserRes 用于查询用户信息对象 type SysUserRes struct { Id int `json:"id" orm:"id"` UserNickname string `json:"userNickname" orm:"user_nickname"` }