busniess-user-center/internal/models/user/user.go

72 lines
1.5 KiB
Go

package models
import (
appModel "busniess-user-center/internal/models/application"
orgModel "busniess-user-center/internal/models/organization"
roleModel "busniess-user-center/internal/models/role"
)
type UserStatus int
const (
EnableUserStatus UserStatus = 1
DisableUserStatus UserStatus = 0
)
type LoginInfo struct {
Account string
Pwd string
}
type AddInfo struct {
Account string `json:"account" binding:"required"`
Name string `json:"name" binding:"required"`
Mobile string `json:"mobile" binding:"required"`
Email string `json:"email" binding:"required"`
Sex int `json:"sex"`
Pwd string `json:"pwd" binding:"required"`
}
type UserInfo struct {
Id uint
Account string
Name string
Mobile string
Email string
Sex int
}
type User struct {
UserInfo
Roles []roleModel.Role
Orgs []orgModel.Organization
Menus appModel.MenuTree
}
type ModifyInfo struct {
Name string `json:"name" binding:"required"`
Sex int `json:"sex"`
}
type ResetPwdReq struct {
Id uint `json:"id" binding:"required"`
OldPwd string `json:"old_pwd" binding:"required"`
Pwd string `json:"pwd" binding:"required"`
}
type GetUserReq struct {
Account string `form:"account" json:"account" binding:"required"`
AppCode string `form:"app_code" json:"app_code" binding:"required"`
}
type Enable struct {
Id uint `json:"id" binding:"required"`
}
type SearchRsp struct {
List []User
Page int
PageSize int
Total int64
}