package dao import ( "time" ) // User 用户 type User struct { ID int64 `gorm:"primary_key" json:"id"` //编号 TenantId string `gorm:"type:varchar(12);default '000000'" json:"tenantId"` //租户id Code string `gorm:"type:varchar(12)" json:"code"` //用户编号 Account string `gorm:"type:varchar(12)" json:"account"` //账号 Password string `gorm:"type:varchar(12)" json:"password"` //密码 Name string `gorm:"type:varchar(12)" json:"name"` //昵称 RealName string `gorm:"type:varchar(12)" json:"real_name"` //真名 Avatar string `gorm:"type:varchar(12)" json:"avatar"` //头像 Email string `gorm:"type:varchar(12)" json:"email"` //邮箱 Phone string `gorm:"type:varchar(12)" json:"phone"` //手机 Birthday string `gorm:"type:datetime" json:"birthday"` //生日 Sex int `gorm:"type:smallint" json:"sex"` //生日 RoleId string `gorm:"type:varchar(1000)" json:"role_id"` //角色id DeptId string `gorm:"type:varchar(1000)" json:"dept_id"` //部门id PostId string `gorm:"type:varchar(1000)" json:"post_id"` //岗位id CreateUser int64 `gorm:"type:bigint" json:"createUser"` //创建人 CreateDept int64 `gorm:"type:bigint" json:"createDept"` //创建部门 CreateTime time.Time `gorm:"type:datetime" json:"createTime"` //新增时间 UpdateUser int64 `gorm:"type:bigint" json:"updateUser"` //修改人 UpdateTime time.Time `gorm:"type:datetime" json:"updateTime"` //修改时间 Status int `gorm:"type:int " json:"status"` //状态 IsDeleted int `gorm:"type:int" json:"isDeleted"` //是否删除 0=未删除,1=删除 GroupId int `gorm:"type:int" json:"groupId"` //用户分组id BigScreenIndexCameraIds string `gorm:"type:varchar(255)" json:"bigScreenIndexCameraIds"` //数据大屏中摄像头保存位置 SecuritySixScreen string `gorm:"type:varchar(255)" json:"security_six_screen"` //安防页面六分屏 } func (User) TableName() string { return "user" } func (c *User) GetUser() error { return GDb.Model(&c).Where("id = ?", c.ID).Find(&c).Error }