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"` //
|
|
|
|
Status *int64 `gorm:"default:1;" json:"status"` //
|
|
|
|
Creator *string `gorm:"default:'';" json:"creator"` //
|
|
|
|
UserDn *string `gorm:"default:'';" json:"user_dn"` //
|
|
|
|
SyncState *int64 `gorm:"default:1;" json:"sync_state"` //
|
|
|
|
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"}
|
|
|
|
}
|