feat: show product identity in ai recommendations
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s

This commit is contained in:
ogt
2026-06-26 18:33:11 +08:00
parent 1dfeee0506
commit c268b5cc02
8 changed files with 226 additions and 25 deletions

View File

@@ -773,11 +773,16 @@ def get_momo_bestsellers(category: str, limit: int = 5) -> Tuple[bool, str, List
result = []
for p in products[:limit]:
result.append({
'id': p.product_id,
'product_id': p.product_id,
'platform': 'momo',
'name': p.name,
'price': p.price,
'original_price': p.original_price,
'discount': p.discount,
'url': p.product_url,
'product_url': p.product_url,
'image_url': p.image_url,
'image': p.image_url
})
return True, f"成功取得 {len(result)} 個熱銷商品", result

View File

@@ -563,11 +563,16 @@ def get_pchome_bestsellers(category: str, limit: int = 5) -> Tuple[bool, str, Li
result = []
for p in products[:limit]:
result.append({
'id': p.product_id,
'product_id': p.product_id,
'platform': 'pchome',
'name': p.name,
'price': p.price,
'original_price': p.original_price,
'discount': p.discount,
'url': p.product_url,
'product_url': p.product_url,
'image_url': p.image_url,
'image': p.image_url
})
return True, f"成功取得 {len(result)} 個熱銷商品", result