Files
backend_v2/internal/model/runway_draft.go
toom1996 6c31b18e0f update
2026-09-17 00:38:01 +08:00

59 lines
3.3 KiB
Go
Raw 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 model
// BrandRunwayDraft 走秀草稿(爬虫入库待审核)。
//
// 爬虫 worker 处理完 ingest_jobs 后不直写正式表,而是写入本表并置为 pending;
// 后台审核通过(Approve)后再晋升(SaveRunwayFromDraft)到 brand_runway 正式表。
// 字段与 brand_runway 对齐(含 review 专用字段),便于审核页直接预览/微调。
type BrandRunwayDraft struct {
ID uint32 `gorm:"primaryKey;column:id" json:"id"`
JobID uint32 `gorm:"column:job_id" json:"job_id"` // 关联 ingest_jobs.id(重跑溯源)
BrandID uint32 `gorm:"column:brand_id" json:"brand_id"` // 品牌数字主键
TitleEn string `gorm:"column:title_en" json:"title_en"`
TitleCn string `gorm:"column:title_cn" json:"title_cn"`
DescriptionEn string `gorm:"column:description_en" json:"description_en"`
DescriptionCn string `gorm:"column:description_cn" json:"description_cn"`
Year uint16 `gorm:"column:year" json:"year"`
Season string `gorm:"column:season" json:"season"`
CollectionType string `gorm:"column:collection_type" json:"collection_type"` // rtw/menswear/couture/resort/pre_fall
SeasonCode string `gorm:"column:season_code" json:"season_code"` // SS26/FW25/RES26/PF25
Cover string `gorm:"column:cover" json:"cover"`
ImageCount uint16 `gorm:"column:image_count" json:"image_count"`
Status string `gorm:"column:status" json:"status"` // pending | approved | rejected
Reviewer string `gorm:"column:reviewer" json:"reviewer"` // 审核人(admin 账号)
RejectReason string `gorm:"column:reject_reason" json:"reject_reason"`
IsDeleted uint8 `gorm:"column:is_deleted" json:"is_deleted"`
CreatedAt uint32 `gorm:"column:created_at" json:"created_at"`
UpdatedAt uint32 `gorm:"column:updated_at" json:"updated_at"`
}
// TableName 指定草稿主表名。
func (BrandRunwayDraft) TableName() string { return "brand_runway_draft" }
// BrandRunwayDraftImage 草稿图片(对应 brand_runway_draft_images)。
type BrandRunwayDraftImage struct {
ID uint32 `gorm:"primaryKey;column:id" json:"id"`
DraftID uint32 `gorm:"column:draft_id" json:"draft_id"`
Image string `gorm:"column:image" json:"image"`
Name string `gorm:"column:name" json:"name"`
SortOrder uint32 `gorm:"column:sort_order" json:"sort_order"`
LookIndex uint32 `gorm:"column:look_index" json:"look_index"` // 细节图归属的主图序号
IsDetail uint8 `gorm:"column:is_detail" json:"is_detail"` // 0=主图 1=细节图
IsDeleted uint8 `gorm:"column:is_deleted" json:"is_deleted"`
CreatedAt uint32 `gorm:"column:created_at" json:"created_at"`
UpdatedAt uint32 `gorm:"column:updated_at" json:"updated_at"`
Phash uint64 `gorm:"column:phash" json:"phash"` // 感知哈希 64-bit;0=未计算
IsDuplicate uint8 `gorm:"column:is_duplicate" json:"is_duplicate"` // 近似重复标记:0=否 1=是(命中留痕不删)
DupOf string `gorm:"column:dup_of" json:"dup_of"` // 近似重复指向的图 uid(hashid),''=非重复
}
// TableName 指定草稿图片表名。
func (BrandRunwayDraftImage) TableName() string { return "brand_runway_draft_images" }
// 草稿状态常量。
const (
DraftStatusPending = "pending"
DraftStatusApproved = "approved"
DraftStatusRejected = "rejected"
)