提交
This commit is contained in:
39
modules/dict/model/dict_info.go
Normal file
39
modules/dict/model/dict_info.go
Normal 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{})
|
||||
}
|
||||
36
modules/dict/model/dict_type.go
Normal file
36
modules/dict/model/dict_type.go
Normal 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{})
|
||||
}
|
||||
Reference in New Issue
Block a user