package backstage_model

import (
	"time"
)

type User struct {
	Id        int64
	User      string
	Password  string
	Email     string
	CreatDate time.Time
	Update    time.Time
}

// SysUsersServiceSignReq  系统用户登录服务类参数结构
type SysUsersServiceSignReq struct {
	User     string `v:"required#登录账号不能为空"`
	Password string `v:"required#密码不能为空"`
	Email    string
}

// SysUsersCreatReq 系统创建用户服务类参数结构
type SysUsersCreatReq struct {
	User     string `v:"required#登录账号不能为空"`
	Password string `v:"required#密码不能为空"`
	Email    string `v:"required#邮箱不能为空"`
}

// SysUserModelResp 系统返回用户信息
type SysUserModelResp struct {
	User      string `orm:"user"`
	UserName  string `orm:"username"`
	UserState string `orm:"user_state"`
	Password  string
	token     string
}

// SysUserName 忘记密码所用校验用户名是否为空操作
type SysUserName struct {
	User string `v:"required#登录账号不能为空"`
}

// UserBasics 系统返回用户信息
type UserBasics struct {
	User  string
	Email string
}

// ChangePassword 修改密码信息验证
type ChangePassword struct {
	User         string `v:"required#登录账号不能为空"`
	Verification string `v:"required#验证码不能为空"`
	Password     string `v:"required#密码不能为空"`
}

// CreatUser 创建用户数据库映射
type CreatUser struct {
	User      string `orm:"user" json:"user"`
	UserName  string `orm:"username" json:"userName"`
	Password  string `orm:"password" json:"password"`
	RealName  string `orm:"real_name" json:"realName"`
	Role      string `orm:"role" json:"role"`
	Phone     string `orm:"phone" json:"phone"`
	Email     string `orm:"email" json:"email"`
	UserState string `orm:"user_state" json:"userState"`
}

// UpdateUser  更新用户数据库映射
type UpdateUser struct {
	User     string `orm:"user" v:"required#id不能为空"`
	UserName string `orm:"username"`
	RealName string `orm:"real_name"`
	Role     string `orm:"role"`
	Password string `orm:"password"`
	Phone    string `orm:"phone"`
	Email    string `orm:"email"`
}

// ChangeStatus  禁用用户数据库映射
type ChangeStatus struct {
	User      string `orm:"user" v:"required#id不能为空"`
	UserState string `orm:"user_state" json:"userState" v:"required#禁用或启用不能为空"`
}

// ChangeListStatus  禁用用户数据库映射
type ChangeListStatus struct {
	User      []string
	UserState string
}

// AllUser  分页查询返回结果
type AllUser struct {
	User          string `orm:"user" json:"backUserId"`
	UserName      string `orm:"username" json:"userName"`
	RealName      string `orm:"real_name" json:"realName"`
	Role          string `orm:"role" json:"role"`
	Phone         string `orm:"phone" json:"phone"`
	Email         string `orm:"email" json:"email"`
	LastLoginTime string `orm:"last_login_time" json:"lastLoginTime"`
	UserState     string `orm:"user_state" json:"userState"`
}

// UserFind 所有分页查询接收信息类型
type UserFind struct {
	IndexPage int `v:"required#页码不能为空"`
	PageSize  int `v:"required#每页展示行数不能为空"`
	User      CreatUser
}
