Files
backend_v2/internal/dto/ingest.go
toom1996 d15d2a4701 update
2026-09-28 10:52:50 +08:00

44 lines
2.5 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package dto
// 入库类型(payload.Kind)。
const (
IngestKindRunway = "runway" // 走秀(默认,需 brand_uid)
IngestKindStreet = "street" // 街拍(无品牌,需 city/title)
)
// RunwayIngest 爬虫上报的单场载荷(ingest_jobs.payload 的 JSON 结构)。
//
// 设计:爬虫只传「元数据 + 图片 URL 列表」,不传图、不直写业务表;
// 下载与存储上传由后台 worker 完成。
//
// 通用字段:
// - Kind: runway | street(决定 worker 走哪条晋升管线;缺省 runway)
// - Images: 图片原始 URL 列表(worker 下载)
//
// runway 专属:BrandUID(品牌 hashid 编码,必填)、TitleEn/TitleCn、Description*、Year、Season、CollectionType。
// street 专属:City(地区/城市)、TitleEn(单标题)。
type RunwayIngest struct {
Kind string `json:"kind"` // runway | street,缺省 runway
BrandUID string `json:"brand_uid"` // 品牌编码 id(hashid),runway 必填
TitleEn string `json:"title_en"` // 英文标题(runway 优先;street 作为单标题)
TitleCn string `json:"title_cn"` // 中文标题(可空)
DescriptionEn string `json:"description_en"` // 英文描述(可空)
DescriptionCn string `json:"description_cn"` // 中文描述(可空)
Year uint16 `json:"year"` // 年份,如 2026
Season string `json:"season"` // spring / fall
CollectionType string `json:"collection_type"` // rtw / menswear / couture / resort / pre_fall
City string `json:"city"` // 地区/城市(street 用)
PublishedAt uint32 `json:"published_at"` // Vogue 详情页 datePublished 的 Unix 时间戳(秒);0=未抽取。标题缺年份时用于矫正 year
Images []string `json:"images"` // 兼容旧 worker:铺平的主图 URL 列表(无细节分组时回退用)
// Looks 结构化「主图 + 细节图」分组(Vogue 一个 gallery item = 1 主图 + N 细节图)。
// 爬虫结构化上报时优先用 Looks;为空时 worker 回退到 Images(全部视为主图,无细节)。
Looks []RunwayLook `json:"looks,omitempty"`
}
// RunwayLook 一场秀中的一个 look:1 张主图 + 0..N 张细节图。
// 主图即对外默认展示的走秀图;细节图挂靠到对应主图,由「细节入口」按需展开。
type RunwayLook struct {
Main string `json:"main"` // 主图(look)原始 URL
Details []string `json:"details"` // 细节图原始 URL 列表
}