You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
4.0 KiB
101 lines
4.0 KiB
package systemuser
|
|
|
|
import "gin_server_admin/global"
|
|
|
|
//系统用户表
|
|
type SystemUser struct {
|
|
Id int64 `json:"id" gorm:"column:u_id;type:bigint(20) unsigned;not null;comment:Id"`
|
|
Name string `json:"name" gorm:"column:u_name;type:varchar(36);not null;comment:用户名"`
|
|
PassWord string `json:"passWord" gorm:"column:u_password;type:varchar(30);not null;comment:密码"`
|
|
Role int64 `json:"role" gorm:"column:u_role;type:bigint(20) unsigned;not null;default:1;comment:用户类型"`
|
|
State int `json:"state" gorm:"column:u_set;type:tinyint(1) unsigned;default:1;not null;comment:是否启用(1:启用;2:禁用;3:删除)"`
|
|
Attribute int64 `json:"attribute" gorm:"column:u_attribute;type:bigint(20) unsigned;not null;default:0;comment:账号属性"`
|
|
Time int64 `json:"time" gorm:"column:u_time;type:bigint(30) unsigned;default:0;not null;comment:创建时间"`
|
|
EiteTime int64 `json:"eiteTime" gorm:"column:u_eite_time;type:bigint(30) unsigned;default:0;not null;comment:修改时间"`
|
|
Key int64 `json:"key" gorm:"column:u_key;type:bigint(50) unsigned;default:0;not null;comment:唯一识别码"`
|
|
Group int64 `json:"group" gorm:"column:u_group;type:bigint(20) unsigned;not null;default:0;comment:集团公司"`
|
|
Wand int `json:"wand" gorm:"column:u_wand;type:tinyint(3) unsigned;default:0;not null;comment:权重"`
|
|
}
|
|
|
|
func (SystemUser *SystemUser) TableName() string {
|
|
return "system_user"
|
|
}
|
|
|
|
//获取详细信息
|
|
func (SystemUser *SystemUser) GetInfo(whereMap map[string]interface{}) (isTrue bool) {
|
|
isTrue = false
|
|
if len(whereMap) < 1 {
|
|
return
|
|
}
|
|
sysUserErr := global.GVA_DB_Master.Where(whereMap).First(&SystemUser).Error
|
|
if sysUserErr == nil {
|
|
isTrue = true
|
|
}
|
|
return
|
|
}
|
|
|
|
//系统管理员属性资料
|
|
type SystemUserAttribute struct {
|
|
IdAttr int64 `json:"id" gorm:"column:ua_id;type:bigint(50) unsigned;not null;comment:Id"`
|
|
NameAttr string `json:"name" gorm:"column:ua_name;type:varchar(20);not null;comment:姓名"`
|
|
Tel string `json:"tel" gorm:"column:ua_tel;type:varchar(30);not null;default:0;comment:电话"`
|
|
TimeAttr int64 `json:"time" gorm:"column:ua_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
|
|
}
|
|
|
|
func (SystemUserAttribute *SystemUserAttribute) TableName() string {
|
|
return "system_user_attribute"
|
|
}
|
|
|
|
//获取详细信息
|
|
func (SystemUser *SystemUserAttribute) GetInfo(whereMap map[string]interface{}) (isTrue bool) {
|
|
isTrue = false
|
|
if len(whereMap) < 1 {
|
|
return
|
|
}
|
|
sysUserErr := global.GVA_DB_Master.Where(whereMap).First(&SystemUser).Error
|
|
if sysUserErr == nil {
|
|
isTrue = true
|
|
}
|
|
return
|
|
}
|
|
|
|
//管理员详细信息
|
|
type SystemAdminDetails struct {
|
|
SystemUser
|
|
SystemUserAttribute
|
|
}
|
|
|
|
//管理员Redis信息
|
|
type RedisAdminInfo struct {
|
|
UserKey string `json:"userkey"`
|
|
UserNumber string `json:"usernumber"`
|
|
UserPwd string `json:"userpwd"`
|
|
UserToken string `json:"usertoken"`
|
|
JurisDiction string `json:"jurisdiction"`
|
|
MenuOper string `json:"menuOper"`
|
|
Wand string `json:"wand"`
|
|
Name string `json:"name"`
|
|
GroupName string `json:"groupname"`
|
|
Group string `json:"group"`
|
|
AttriBute string `json:"attribute"`
|
|
BranchFactoryName string `json:"branchfactoryname"`
|
|
Role string `json:"role"`
|
|
RoleName string `json:"roleName"`
|
|
}
|
|
|
|
type RedisAdminInfoNew struct {
|
|
UserKey string `json:"userkey"`
|
|
UserNumber string `json:"usernumber"`
|
|
UserPwd string `json:"userpwd"`
|
|
UserToken string `json:"usertoken"`
|
|
JurisDiction string `json:"jurisdiction"`
|
|
MenuOper string `json:"menuOper"`
|
|
Wand string `json:"wand"`
|
|
Name string `json:"name"`
|
|
GroupName string `json:"groupname"`
|
|
Group string `json:"group"`
|
|
AttriBute string `json:"attribute"`
|
|
BranchFactoryName string `json:"branchfactoryname"`
|
|
Role string `json:"role"`
|
|
RoleName string `json:"roleName"`
|
|
}
|
|
|