36 lines
1.8 KiB
Go
36 lines
1.8 KiB
Go
package gmodel
|
||
|
||
import (
|
||
"gorm.io/gorm"
|
||
"time"
|
||
)
|
||
|
||
// ldap_users
|
||
type LdapUsers struct {
|
||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||
Name *string `gorm:"default:'';" json:"name"` //
|
||
Nickname *string `gorm:"default:'';" json:"nickname"` //
|
||
Email *string `gorm:"default:'';" json:"email"` //
|
||
EnterpriseEmail *string `gorm:"default:'';" json:"enterprise_email"` //
|
||
JobTitle *string `gorm:"default:'';" json:"job_title"` //
|
||
Mobile *string `gorm:"default:'';" json:"mobile"` //
|
||
Gender *int64 `gorm:"default:0;" json:"gender"` // 性别 0未知 1男 2女
|
||
Avatar *string `gorm:"default:'';" json:"avatar"` //
|
||
Status *int64 `gorm:"default:1;" json:"status"` // 状态 0禁止 1正常
|
||
Departmentids *string `gorm:"default:'';" json:"departmentIds"` //
|
||
EmployeeType *int64 `gorm:"default:0;" json:"employee_type"` // 1:正式员工 2:实习生 3:外包4:劳务 5:顾问
|
||
UserDn *string `gorm:"default:'';" json:"user_dn"` //
|
||
JoinTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"join_time"` //
|
||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||
Dtime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"dtime"` //
|
||
}
|
||
type LdapUsersModel struct {
|
||
db *gorm.DB
|
||
name string
|
||
}
|
||
|
||
func NewLdapUsersModel(db *gorm.DB) *LdapUsersModel {
|
||
return &LdapUsersModel{db: db, name: "ldap_users"}
|
||
}
|