package models //User 用户数据映射模型 type User struct { Password string `gorm:"password"` UserName string `gorm:"user_name"` Role *uint8 `gorm:"role" ` Id string `gorm:"id"` } type UserRegister struct { Id string `json:"id"` UserName string `json:"userName" binding:"required"` Password string `json:"password" binding:"required"` Role *uint8 `json:"role" binding:"required,gte=0" ` } type UserLogin struct { Username string `json:"username" binding:"required"` Password string `json:"password" binding:"required"` Role *uint8 `json:"role" binding:"required,gte=0"` } type ResetPassword struct { Username string `json:"username" binding:"required"` UsernameInit string `json:"usernameInit" binding:"required"` } type UserListParam struct { PageNum int `json:"pageNum" binding:"required,gt=0"` PageSize int `json:"pageSize" binding:"required,gt=1"` UserName string `json:"userName"` Role *uint8 `json:"role" binding:"required,gte=0"` } type ChangePassword struct { UserName string `json:"userName" binding:"required"` Password string `json:"password" binding:"required"` NewPassword string `json:"newPassword" binding:"required"` }