1 Star 0 Fork 75

qmhl开到荼蘼/go-ldap-admin

forked from opsre/go-ldap-admin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
user.go 3.58 KB
一键复制 编辑 原始数据 按行查看 历史
eryajf 提交于 2022-07-18 15:36 +08:00 . fix: 飞书手机号超过11位的问题 (#85)
package model
import "gorm.io/gorm"
type User struct {
gorm.Model
Username string `gorm:"type:varchar(50);not null;unique;comment:'用户名'" json:"username"` // 用户名
Password string `gorm:"size:255;not null;comment:'用户密码'" json:"password"` // 用户密码
Nickname string `gorm:"type:varchar(50);comment:'中文名'" json:"nickname"` // 昵称
GivenName string `gorm:"type:varchar(50);comment:'花名'" json:"givenName"` // 花名,如果有的话,没有的话用昵称占位
Mail string `gorm:"type:varchar(100);comment:'邮箱'" json:"mail"` // 邮箱
JobNumber string `gorm:"type:varchar(20);comment:'工号'" json:"jobNumber"` // 工号
Mobile string `gorm:"type:varchar(15);not null;unique;comment:'手机号'" json:"mobile"` // 手机号
Avatar string `gorm:"type:varchar(255);comment:'头像'" json:"avatar"` // 头像
PostalAddress string `gorm:"type:varchar(255);comment:'地址'" json:"postalAddress"` // 地址
Departments string `gorm:"type:varchar(128);comment:'部门'" json:"departments"` // 部门
Position string `gorm:"type:varchar(128);comment:'职位'" json:"position"` // 职位
Introduction string `gorm:"type:varchar(255);comment:'个人简介'" json:"introduction"` // 个人简介
Status uint `gorm:"type:tinyint(1);default:1;comment:'状态:1在职, 2离职'" json:"status"` // 状态
Creator string `gorm:"type:varchar(20);;comment:'创建者'" json:"creator"` // 创建者
Source string `gorm:"type:varchar(50);comment:'用户来源:dingTalk、wecom、feishu、ldap、platform'" json:"source"` // 来源
DepartmentId string `gorm:"type:varchar(100);not null;comment:'部门id'" json:"departmentId"` // 部门id
Roles []*Role `gorm:"many2many:user_roles" json:"roles"` // 角色
SourceUserId string `gorm:"type:varchar(100);not null;comment:'第三方用户id'" json:"sourceUserId"` // 第三方用户id
SourceUnionId string `gorm:"type:varchar(100);not null;comment:'第三方唯一unionId'" json:"sourceUnionId"` // 第三方唯一unionId
UserDN string `gorm:"type:varchar(255);not null;comment:'用户dn'" json:"userDn"` // 用户在ldap的dn
}
func (u *User) SetUserName(userName string) {
u.Username = userName
}
func (u *User) SetNickName(nickName string) {
u.Nickname = nickName
}
func (u *User) SetGivenName(givenName string) {
u.GivenName = givenName
}
func (u *User) SetMail(mail string) {
u.Mail = mail
}
func (u *User) SetJobNumber(jobNum string) {
u.JobNumber = jobNum
}
func (u *User) SetMobile(mobile string) {
u.Mobile = mobile
}
func (u *User) SetAvatar(avatar string) {
u.Avatar = avatar
}
func (u *User) SetPostalAddress(address string) {
u.PostalAddress = address
}
func (u *User) SetPosition(position string) {
u.Position = position
}
func (u *User) SetIntroduction(desc string) {
u.Introduction = desc
}
func (u *User) SetSourceUserId(sourceUserId string) {
u.SourceUserId = sourceUserId
}
func (u *User) SetSourceUnionId(sourceUnionId string) {
u.SourceUnionId = sourceUnionId
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/zhangqiqmhl/go-ldap-admin.git
git@gitee.com:zhangqiqmhl/go-ldap-admin.git
zhangqiqmhl
go-ldap-admin
go-ldap-admin
main

搜索帮助

371d5123 14472233 46e8bd33 14472233