fusenapi/model/gmodel/ldap_department_gen.go

30 lines
1.2 KiB
Go
Raw Normal View History

2023-11-13 09:59:46 +00:00
package gmodel
import (
2023-11-14 03:45:25 +00:00
"gorm.io/gorm"
2023-11-14 06:20:14 +00:00
"time"
2023-11-13 09:59:46 +00:00
)
// ldap_department 部门表
type LdapDepartment struct {
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
2023-11-14 06:20:14 +00:00
Name *string `gorm:"unique_key;default:'';" json:"name"` //
Remark *string `gorm:"unique_key;default:'';" json:"remark"` //
2023-11-13 09:59:46 +00:00
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"` //
2023-11-14 06:20:14 +00:00
SyncState *int64 `gorm:"default:1;" json:"sync_state"` // 同步状态:1已同步, 2未同步
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"}
}