提交货源流程优化

This commit is contained in:
super
2026-05-25 22:16:50 +08:00
parent 7503e3fa8b
commit 73ac9187a6
14 changed files with 1490 additions and 85 deletions

View File

@@ -0,0 +1,18 @@
-- P2-12相似ASIN/通用 图片缩略图缓存表。
-- 用于跨任务复用 Coze 回包中的 main_url / puzzle_img1 / puzzle_img2 等图片,
-- 与 SimilarAsinImagePrefetchService 协作,避免 assemble 阶段每次都重新下载远程图片。
-- url_hash 走 sha256(lowercase hex),避免 1024 长 URL 作为唯一键命中索引长度限制。
CREATE TABLE IF NOT EXISTS biz_task_image_cache (
id BIGINT NOT NULL AUTO_INCREMENT,
url_hash CHAR(64) NOT NULL COMMENT 'sha256 lowercase hex of url',
url VARCHAR(1024) NOT NULL,
image_bytes MEDIUMBLOB NOT NULL COMMENT '已 resize 缩略图字节,最大约 300KB',
byte_size INT NOT NULL DEFAULT 0,
width INT NOT NULL DEFAULT 0,
height INT NOT NULL DEFAULT 0,
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
last_used_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (id),
UNIQUE KEY uk_task_image_cache_url_hash (url_hash),
KEY idx_task_image_cache_last_used_at (last_used_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='相似ASIN/通用 图片缩略图缓存,跨任务复用';