feat(*): go 后端项目脚手架
This commit is contained in:
18
internal/model/site.go
Normal file
18
internal/model/site.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Site struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt *time.Time `gorm:"index" json:"-"`
|
||||
|
||||
Name string `gorm:"size:100;not null;unique" json:"name"`
|
||||
Describe string `gorm:"size:100" json:"describe"`
|
||||
CateageID uint `gorm:"not null;index" json:"cateage_id"`
|
||||
Cateage Cateage `gorm:"foreignKey:CateageID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"cateage"` // 外键关联
|
||||
Url string `gorm:"size:500;not null" json:"url"`
|
||||
Cors bool `gorm:"default:false" json:"cors"`
|
||||
Icon string `gorm:"size:500;default:'https://cos.kmux.cn/md/20251115174627218.png'" json:"icon"`
|
||||
}
|
||||
Reference in New Issue
Block a user