56 lines
3.5 KiB
Go
56 lines
3.5 KiB
Go
// Package entity 实体层
|
|
package entity
|
|
|
|
import "time"
|
|
|
|
// SysUser 用户表实体
|
|
type SysUser struct {
|
|
ID string `gorm:"column:id;primaryKey" json:"id"`
|
|
Username string `gorm:"column:username" json:"username"` // 登录账号
|
|
Realname string `gorm:"column:realname" json:"realname"` // 真实姓名
|
|
Password string `gorm:"column:password" json:"-"` // 密码 (不返回给前端)
|
|
Salt string `gorm:"column:salt" json:"-"` // md5密码盐
|
|
Avatar string `gorm:"column:avatar" json:"avatar"` // 头像
|
|
Birthday *time.Time `gorm:"column:birthday" json:"birthday"` // 生日
|
|
Sex int `gorm:"column:sex" json:"sex"` // 性别(0-未知,1-男,2-女)
|
|
Email string `gorm:"column:email" json:"email"` // 电子邮件
|
|
Phone string `gorm:"column:phone" json:"phone"` // 电话
|
|
OrgCode string `gorm:"column:org_code" json:"orgCode"` // 机构编码
|
|
Status int `gorm:"column:status" json:"status"` // 状态(1-正常,2-冻结)
|
|
DelFlag int `gorm:"column:del_flag" json:"delFlag"` // 删除状态(0-正常,1-已删除)
|
|
ThirdID string `gorm:"column:third_id" json:"thirdId"` // 第三方登录唯一标识
|
|
ThirdType string `gorm:"column:third_type" json:"thirdType"` // 第三方类型
|
|
ActivitiSync int `gorm:"column:activiti_sync" json:"activitiSync"` // 同步工作流引擎
|
|
WorkNo string `gorm:"column:work_no" json:"workNo"` // 工号
|
|
Telephone string `gorm:"column:telephone" json:"telephone"` // 座机号
|
|
CreateBy string `gorm:"column:create_by" json:"createBy"` // 创建人
|
|
CreateTime *time.Time `gorm:"column:create_time" json:"createTime"` // 创建时间
|
|
UpdateBy string `gorm:"column:update_by" json:"updateBy"` // 更新人
|
|
UpdateTime *time.Time `gorm:"column:update_time" json:"updateTime"` // 更新时间
|
|
UserIdentity int `gorm:"column:user_identity" json:"userIdentity"` // 身份(1普通成员 2上级)
|
|
DepartIds string `gorm:"column:depart_ids" json:"departIds"` // 负责部门
|
|
ClientID string `gorm:"column:client_id" json:"clientId"` // 设备ID
|
|
LoginTenantID int `gorm:"column:login_tenant_id" json:"loginTenantId"` // 上次登录租户ID
|
|
BpmStatus string `gorm:"column:bpm_status" json:"bpmStatus"` // 流程状态
|
|
WxOpenID string `gorm:"column:wx_open_id" json:"wxOpenId"` // 微信openId
|
|
DyOpenID string `gorm:"column:dy_open_id" json:"dyOpenId"` // 抖音openId
|
|
IP string `gorm:"column:ip" json:"ip"` // 注册时ip
|
|
ShowLinediff string `gorm:"column:show_linediff" json:"showLinediff"` // 是否显示历年线差
|
|
ProgramType string `gorm:"column:program_type" json:"programType"` // 所属程序
|
|
}
|
|
|
|
func (SysUser) TableName() string {
|
|
return "sys_user"
|
|
}
|
|
|
|
// LoginUser 登录用户信息 (存储在Redis中)
|
|
type LoginUser struct {
|
|
ID string `json:"id"`
|
|
Username string `json:"username"`
|
|
Realname string `json:"realname"`
|
|
Avatar string `json:"avatar"`
|
|
Phone string `json:"phone"`
|
|
Email string `json:"email"`
|
|
Token string `json:"token"`
|
|
}
|