提交
This commit is contained in:
1
modules/space/model/model.go
Normal file
1
modules/space/model/model.go
Normal file
@@ -0,0 +1 @@
|
||||
package model
|
||||
37
modules/space/model/space_info.go
Normal file
37
modules/space/model/space_info.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/cool-team-official/cool-admin-go/cool"
|
||||
)
|
||||
|
||||
const TableNameSpaceInfo = "space_info"
|
||||
|
||||
// SpaceInfo mapped from table <space_info>
|
||||
type SpaceInfo struct {
|
||||
*cool.Model
|
||||
URL string `gorm:"column:url;type:varchar(255);not null;comment:地址" json:"url"` // 地址
|
||||
Type string `gorm:"column:type;type:varchar(255);not null;comment:类型" json:"type"` // 类型
|
||||
ClassifyID *int64 `gorm:"column:classifyId;type:bigint;comment:分类ID" json:"classifyId"` // 分类ID
|
||||
}
|
||||
|
||||
// TableName SpaceInfo's table name
|
||||
func (*SpaceInfo) TableName() string {
|
||||
return TableNameSpaceInfo
|
||||
}
|
||||
|
||||
// GroupName SpaceInfo's table group
|
||||
func (*SpaceInfo) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewSpaceInfo create a new SpaceInfo
|
||||
func NewSpaceInfo() *SpaceInfo {
|
||||
return &SpaceInfo{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&SpaceInfo{})
|
||||
}
|
||||
36
modules/space/model/space_type.go
Normal file
36
modules/space/model/space_type.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/cool-team-official/cool-admin-go/cool"
|
||||
)
|
||||
|
||||
const TableNameSpaceType = "space_type"
|
||||
|
||||
// SpaceType mapped from table <space_type>
|
||||
type SpaceType struct {
|
||||
*cool.Model
|
||||
Name string `gorm:"column:name;type:varchar(255);not null;comment:类别名称 " json:"name"` // 类别名称
|
||||
ParentID *int32 `gorm:"column:parentId;comment:父分类ID" json:"parentId"` // 父分类ID
|
||||
}
|
||||
|
||||
// TableName SpaceType's table name
|
||||
func (*SpaceType) TableName() string {
|
||||
return TableNameSpaceType
|
||||
}
|
||||
|
||||
// GroupName SpaceType's table group
|
||||
func (*SpaceType) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewSpaceType create a new SpaceType
|
||||
func NewSpaceType() *SpaceType {
|
||||
return &SpaceType{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&SpaceType{})
|
||||
}
|
||||
Reference in New Issue
Block a user