29 lines
1.1 KiB
Go
29 lines
1.1 KiB
Go
|
package gmodel
|
||
|
|
||
|
import (
|
||
|
"gorm.io/gorm"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
// ldap_department 部门表
|
||
|
type LdapDepartment struct {
|
||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||
|
Name *string `gorm:"default:'';" json:"name"` //
|
||
|
Remark *string `gorm:"default:'';" json:"remark"` //
|
||
|
Creator *string `gorm:"default:'';" json:"creator"` //
|
||
|
Type *string `gorm:"default:'';" json:"type"` //
|
||
|
ParentId *int64 `gorm:"default:0;" json:"parent_id"` //
|
||
|
Dn *string `gorm:"default:'';" json:"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 LdapDepartmentModel struct {
|
||
|
db *gorm.DB
|
||
|
name string
|
||
|
}
|
||
|
|
||
|
func NewLdapDepartmentModel(db *gorm.DB) *LdapDepartmentModel {
|
||
|
return &LdapDepartmentModel{db: db, name: "ldap_department"}
|
||
|
}
|