chore(publish): 删除草稿表与草稿模型

This commit is contained in:
toom1996
2026-09-23 13:55:24 +08:00
parent c4bafc5b41
commit d68a57009c
6 changed files with 672 additions and 2325 deletions

View File

@ -26,16 +26,14 @@ func NewMediaRepository(db *gorm.DB) MediaRepository {
return &mediaRepository{db: db}
}
// imageTables 保存S4 key 的全部图片明细表(已晋升的正式表 + 待审草稿表)。
// 引用计数必须覆盖这 4 张,漏掉任意一张都会把「仍被引用」误判为孤儿而误删。
// imageTables 保存S4 key 的全部图片明细表(单表发布模型下即两张正式图片表)。
// 引用计数必须覆盖全部图片表,漏掉任意一张都会把「仍被引用」误判为孤儿而误删。
var imageTables = []string{
"brand_runway_images",
"brand_runway_draft_images",
"street_snap_images",
"street_snap_draft_images",
}
// CountImageKeyRefs 跨 4 张表统计 key 的存活引用数(is_deleted=0)。
// CountImageKeyRefs 跨全部图片明细表统计 key 的存活引用数(is_deleted=0)。
func (r *mediaRepository) CountImageKeyRefs(ctx context.Context, key string) (int, error) {
if key == "" {
return 0, nil