2023-11-13 09:59:46 +00:00
|
|
|
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"` //
|
2023-11-13 10:57:11 +00:00
|
|
|
ParentId *int64 `gorm:"default:0;" json:"parent_id"` // 层级如 10/20/30
|
2023-11-13 09:59:46 +00:00
|
|
|
Dn *string `gorm:"default:'';" json:"dn"` //
|
|
|
|
SyncState *int64 `gorm:"default:1;" json:"sync_state"` //
|
2023-11-14 03:57:09 +00:00
|
|
|
Sort *int64 `gorm:"default:999;" json:"sort"` // 排序
|
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 LdapDepartmentModel struct {
|
|
|
|
db *gorm.DB
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewLdapDepartmentModel(db *gorm.DB) *LdapDepartmentModel {
|
|
|
|
return &LdapDepartmentModel{db: db, name: "ldap_department"}
|
|
|
|
}
|