feat(meituan-coupon): 头图改为统一压缩(去掉大小阈值,全部拼缩放参数)

产品要求所有头图都压缩,不再按 image_size 阈值判定:
- feed_image_url 改为无条件给图片 URL 拼 @375w_375h_1e_1c.webp(缩 124dp + 转 WebP)
- 去掉 FEED_THUMB_SIZE_THRESHOLD 阈值常量;from_raw / 两处 DB 路不再传 image_size
- image_size/image_type 两列保留用于分析/监控(GIF 占比、体积分布),采集逻辑不变
- 文档更新:head_image_url 现统一带缩放参数

注:读取侧统一压缩,部署后即对全部 feed 图生效,无需依赖 image_size 回填。
This commit is contained in:
chenshuobo
2026-06-23 20:23:02 +08:00
parent 32266742b5
commit 7d1eaf5829
4 changed files with 14 additions and 20 deletions
+2 -2
View File
@@ -202,7 +202,7 @@ def feed(req: FeedRequest, db: Session = Depends(get_db)) -> FeedResponse:
cards: list[CouponCard] = []
for row in rows[:PAGE]:
try:
card = CouponCard.from_raw(row.raw or {}, image_size=row.image_size)
card = CouponCard.from_raw(row.raw or {})
except Exception: # noqa: BLE001
continue
if card.product_view_sign:
@@ -288,7 +288,7 @@ def top_sales(req: TopSalesRequest, db: Session = Depends(get_db)) -> CouponList
cards: list[CouponCard] = []
for row in rows[:req.page_size]:
try:
card = CouponCard.from_raw(row.raw or {}, image_size=row.image_size)
card = CouponCard.from_raw(row.raw or {})
except Exception: # noqa: BLE001
continue
if card.product_view_sign: