Files
GoGinScaffold/internal/model/site.go

19 lines
755 B
Go

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"`
}