Files
bl/modules/base/model/base_sys_department.go
xinian e47ada7e58
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
1
2026-02-13 06:02:32 +08:00

31 lines
852 B
Go

package model
import "blazing/cool"
const TableNameBaseSysDepartment = "base_sys_department"
// BaseSysDepartment mapped from table <base_sys_department>
type BaseSysDepartment struct {
*cool.Model
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 部门名称
ParentID uint `gorm:"column:parentId;type:bigint" json:"parentId"` // 上级部门ID
Ordernum int32 `gorm:"column:ordernum;type:int;not null" json:"ordernum"` // 排序
}
// TableName BaseSysDepartment's table name
func (*BaseSysDepartment) TableName() string {
return TableNameBaseSysDepartment
}
// NewBaseSysDepartment 创建一个BaseSysDepartment实例
func NewBaseSysDepartment() *BaseSysDepartment {
return &BaseSysDepartment{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&BaseSysDepartment{})
}