2023-11-13 09:59:46 +00:00
|
|
|
package gmodel
|
|
|
|
|
|
|
|
import (
|
|
|
|
"gorm.io/gorm"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ldap_users 用户表
|
|
|
|
type LdapUsers struct {
|
|
|
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
|
|
|
Username *string `gorm:"unique_key;default:'';" json:"username"` //
|
|
|
|
Password *string `gorm:"default:'';" json:"password"` //
|
|
|
|
Nickname *string `gorm:"default:'';" json:"nickname"` //
|
|
|
|
GivenName *string `gorm:"default:'';" json:"given_name"` //
|
2023-11-13 10:57:11 +00:00
|
|
|
Email *string `gorm:"unique_key;default:'';" json:"email"` //
|
2023-11-13 09:59:46 +00:00
|
|
|
JobNumber *string `gorm:"default:'';" json:"job_number"` //
|
|
|
|
Mobile *string `gorm:"unique_key;default:'';" json:"mobile"` //
|
|
|
|
Avatar *string `gorm:"default:'';" json:"avatar"` //
|
|
|
|
Position *string `gorm:"default:'';" json:"position"` //
|
|
|
|
Introduction *string `gorm:"default:'';" json:"introduction"` //
|
2023-11-14 06:20:14 +00:00
|
|
|
Status *int64 `gorm:"default:1;" json:"status"` // 状态:1在职, 2离职
|
2023-11-13 09:59:46 +00:00
|
|
|
Creator *string `gorm:"default:'';" json:"creator"` //
|
|
|
|
UserDn *string `gorm:"default:'';" json:"user_dn"` //
|
2023-11-14 06:20:14 +00:00
|
|
|
SyncState *int64 `gorm:"default:1;" json:"sync_state"` // 同步状态:1已同步, 2未同步
|
2023-11-13 09:59:46 +00:00
|
|
|
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"` //
|
|
|
|
}
|
|
|
|
type LdapUsersModel struct {
|
|
|
|
db *gorm.DB
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewLdapUsersModel(db *gorm.DB) *LdapUsersModel {
|
|
|
|
return &LdapUsersModel{db: db, name: "ldap_users"}
|
|
|
|
}
|