Files
spider/internal/model/models.go
toom1996 ad83d3d463 update
2026-08-25 16:25:28 +08:00

79 lines
3.1 KiB
Go

package model
// AppBrand 品牌数据表模型
type AppBrand struct {
ID int64 `gorm:"primaryKey;column:id"`
Name string `gorm:"column:name"`
SpiderOrigin string `gorm:"column:spider_origin"`
}
func (AppBrand) TableName() string {
return "app_brands" // 根据实际表名调整
}
// BrandRunway 时尚发布会主表
type BrandRunway struct {
ID uint `gorm:"primaryKey;column:id;autoIncrement" json:"id"`
Title string `gorm:"column:title" json:"title"`
Description string `gorm:"column:description" json:"description"`
CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"`
IsDeleted uint8 `gorm:"column:is_deleted" json:"is_deleted"`
ImageCount uint16 `gorm:"column:image_count" json:"image_count"`
BrandID uint `gorm:"column:brand_id" json:"brand_id"`
Year uint16 `gorm:"column:year" json:"year"`
Cover string `gorm:"column:cover" json:"cover"`
SourceURL string `gorm:"column:source_url" json:"source_url"`
CollectionType string `gorm:"column:collection_type" json:"collection_type"`
Season string `gorm:"column:season" json:"season"`
SeasonCode string `gorm:"column:season_code" json:"season_code"`
}
// TableName 指定主表名
func (BrandRunway) TableName() string {
return "brand_runway"
}
// BrandRunwayImage 发布会图片表
type BrandRunwayImage struct {
ID uint `gorm:"primaryKey;column:id;autoIncrement" json:"id"`
CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"`
IsDeleted uint8 `gorm:"column:is_deleted" json:"is_deleted"`
Image string `gorm:"column:image" json:"image"`
RunwayID uint `gorm:"column:runway_id" json:"runway_id"`
BrandID uint `gorm:"column:brand_id" json:"brand_id"`
Name string `gorm:"column:name" json:"name"`
SortOrder uint `gorm:"column:sort_order" json:"sort_order"`
}
// TableName 指定图片明细表名
func (BrandRunwayImage) TableName() string {
return "brand_runway_images"
}
// Article The Impression 街拍文章表(对应 PHP 的 articles 模型)
// 字段与 PHP 的 ArticleModuleEnum::STREET 文章结构保持一致
type Article struct {
ID uint `gorm:"primaryKey;column:id;autoIncrement" json:"id"`
Title string `gorm:"column:title" json:"title"`
Platform string `gorm:"column:platform" json:"platform"`
Module string `gorm:"column:module" json:"module"`
Year uint16 `gorm:"column:year" json:"year"`
Cover string `gorm:"column:cover" json:"cover"`
Images string `gorm:"column:images" json:"images"`
SourceURL string `gorm:"column:source_url" json:"source_url"`
Brand uint `gorm:"column:brand;default:0" json:"brand"`
CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"`
}
// TableName 指定文章主表名
func (Article) TableName() string {
return "articles"
}
// ImageItem 图片条目,序列化进 Article.Images(JSON 数组)
type ImageItem struct {
Src string `json:"src"`
}