12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package models
- import "gorm.io/gorm"
- //User 用户数据映射模型
- type User struct {
- gorm.Model
- Password string `gorm:"password"`
- UserName string `gorm:"user_name"`
- Phone string `gorm:"phone"`
- Role *uint8 `gorm:"role" `
- }
- type UserRegister struct {
- Phone string `json:"phone" binding:"required"`
- UserName string `json:"userName" binding:"required"`
- Password string `json:"password" binding:"required"`
- Role *uint8 `json:"role" binding:"required,gte=0" `
- }
- type UserLogin struct {
- Phone string `json:"phone" binding:"required"`
- Password string `json:"password" binding:"required"`
- Role *uint8 `json:"role" binding:"required,gte=0"`
- }
- type ResetPassword struct {
- Phone string `json:"phone" binding:"required"`
- PhoneInit string `json:"phoneInit" 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 {
- Phone string `json:"phone" binding:"required"`
- Password string `json:"password" binding:"required"`
- NewPassword string `json:"newPassword" binding:"required"`
- }
|