This commit is contained in:
2025-06-20 17:13:51 +08:00
parent 1b55403cd6
commit fd0345a034
472 changed files with 52560 additions and 77 deletions

View File

@@ -0,0 +1,39 @@
package model
import (
"github.com/cool-team-official/cool-admin-go/cool"
)
const TableNameDictInfo = "dict_info"
// DictInfo mapped from table <dict_info>
type DictInfo struct {
*cool.Model
TypeID int32 `gorm:"column:typeId;type:int;not null" json:"typeId"` // 类型ID
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 名称
OrderNum int32 `gorm:"column:orderNum;type:int;not null" json:"orderNum"` // 排序
Remark *string `gorm:"column:remark;type:varchar(255)" json:"remark"` // 备注
ParentID *int32 `gorm:"column:parentId;type:int" json:"parentId"` // 父ID
}
// TableName DictInfo's table name
func (*DictInfo) TableName() string {
return TableNameDictInfo
}
// GroupName DictInfo's table group
func (*DictInfo) GroupName() string {
return "default"
}
// NewDictInfo create a new DictInfo
func NewDictInfo() *DictInfo {
return &DictInfo{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&DictInfo{})
}

View File

@@ -0,0 +1,36 @@
package model
import (
"github.com/cool-team-official/cool-admin-go/cool"
)
const TableNameDictType = "dict_type"
// DictType mapped from table <dict_type>
type DictType struct {
*cool.Model
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 名称
Key string `gorm:"column:key;type:varchar(255);not null" json:"key"` // 标识
}
// TableName DictType's table name
func (*DictType) TableName() string {
return TableNameDictType
}
// GroupName DictType's table group
func (*DictType) GroupName() string {
return "default"
}
// NewDictType create a new DictType
func NewDictType() *DictType {
return &DictType{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&DictType{})
}