chore(publish): 删除草稿表与草稿模型
This commit is contained in:
@ -1,62 +0,0 @@
|
||||
package model
|
||||
|
||||
import "database/sql"
|
||||
|
||||
// BrandRunwayDraft 走秀草稿(爬虫入库待审核)。
|
||||
//
|
||||
// 爬虫 worker 处理完 ingest_jobs 后不直写正式表,而是写入本表并置为 pending;
|
||||
// 后台审核通过(Approve)后再晋升(SaveRunwayFromDraft)到 brand_runways 正式表。
|
||||
// 字段与 brand_runways 对齐(含 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_drafts" }
|
||||
|
||||
// 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"`
|
||||
|
||||
// 去重字段:见 BrandRunwayImage 注释。phash 为 vector(64) 二进制向量(NULL=无法解码)。
|
||||
Phash sql.NullString `gorm:"column:phash;type:vector(64)" json:"phash"`
|
||||
IsDuplicate uint8 `gorm:"column:is_duplicate;not null;default:0" json:"is_duplicate"`
|
||||
DupOf string `gorm:"column:dup_of;type:varchar(32);not null;default:''" json:"dup_of"`
|
||||
}
|
||||
|
||||
// TableName 指定草稿图片表名。
|
||||
func (BrandRunwayDraftImage) TableName() string { return "brand_runway_draft_images" }
|
||||
|
||||
// 草稿状态常量。
|
||||
const (
|
||||
DraftStatusPending = "pending"
|
||||
DraftStatusApproved = "approved"
|
||||
DraftStatusRejected = "rejected"
|
||||
)
|
||||
@ -1,55 +0,0 @@
|
||||
package model
|
||||
|
||||
import "database/sql"
|
||||
|
||||
// StreetSnapDraft 街拍草稿(爬虫入库待审核)。
|
||||
//
|
||||
// 与 brand_runway_drafts 同构的审核流程:爬虫 worker 处理完 ingest_jobs 后写入本表并置
|
||||
// pending;后台审核通过(Approve)后再晋升(SaveStreetSnapFromDraft)到 street_snaps 正式表。
|
||||
//
|
||||
// 字段对齐 street_snaps 正式表(单 Title、有 City、无 brand_id、无 season 系列列),
|
||||
// 外加审核专用字段,便于审核页直接预览/微调。
|
||||
type StreetSnapDraft struct {
|
||||
ID uint32 `gorm:"primaryKey;column:id" json:"id"`
|
||||
JobID uint32 `gorm:"column:job_id" json:"job_id"` // 关联 ingest_jobs.id(重跑溯源)
|
||||
Title string `gorm:"column:title" json:"title"` // 单标题(街拍无双语)
|
||||
Year uint16 `gorm:"column:year" json:"year"`
|
||||
City string `gorm:"column:city" json:"city"` // 地区/城市,'' 表示未归类
|
||||
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 (StreetSnapDraft) TableName() string { return "street_snap_drafts" }
|
||||
|
||||
// StreetSnapDraftImage 街拍草稿图片(对应 street_snap_draft_images)。
|
||||
type StreetSnapDraftImage 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"`
|
||||
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"`
|
||||
|
||||
// 去重字段:见 BrandRunwayImage 注释。phash 为 vector(64) 二进制向量(NULL=无法解码)。
|
||||
Phash sql.NullString `gorm:"column:phash;type:vector(64)" json:"phash"`
|
||||
IsDuplicate uint8 `gorm:"column:is_duplicate;not null;default:0" json:"is_duplicate"`
|
||||
DupOf string `gorm:"column:dup_of;type:varchar(32);not null;default:''" json:"dup_of"`
|
||||
|
||||
// 主副图分组(列由 db/migrations/2026-09-21-01-street-main-detail.sql 添加):
|
||||
// is_detail=0 为主图(parent_image_id=0);=1 为副图,parent_image_id 指向同草稿内主图的行 id。
|
||||
// 存行 id 而非序号:序号会因重排 / 插入 / 删除而失效。
|
||||
IsDetail uint8 `gorm:"column:is_detail;not null;default:0" json:"is_detail"`
|
||||
ParentImageID uint32 `gorm:"column:parent_image_id;not null;default:0" json:"parent_image_id"`
|
||||
}
|
||||
|
||||
// TableName 指定草稿图片表名。
|
||||
func (StreetSnapDraftImage) TableName() string { return "street_snap_draft_images" }
|
||||
Reference in New Issue
Block a user