routing
This commit is contained in:
21
app/model/routing.go
Normal file
21
app/model/routing.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package model
|
||||
|
||||
type Route struct {
|
||||
ID uint `gorm:"primaryKey;autoIncrement"`
|
||||
Name string `gorm:"type:varchar(255);not null;unique"`
|
||||
Path *string `gorm:"type:varchar(255);default:null"`
|
||||
Component string `gorm:"type:varchar(255);not null;comment:path to component file"`
|
||||
Layout *string `gorm:"type:varchar(50);default:'default';comment:'default | empty'"`
|
||||
Meta *string `gorm:"type:longtext;default:'{}'"`
|
||||
IsActive *bool `gorm:"type:tinyint;default:1"`
|
||||
SortOrder *int `gorm:"type:int;default:0"`
|
||||
|
||||
ParentID *uint `gorm:"index"`
|
||||
Parent *Route `gorm:"constraint:OnUpdate:RESTRICT,OnDelete:SET NULL;foreignKey:ParentID"`
|
||||
|
||||
Children []Route `gorm:"foreignKey:ParentID"`
|
||||
}
|
||||
|
||||
func (Route) TableName() string {
|
||||
return "b2b_routes"
|
||||
}
|
||||
Reference in New Issue
Block a user