Some checks failed
CD Pipeline / deploy (push) Failing after 59s
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml) - 部署模式: rsync Python 檔案至 188 → docker restart (volume mount) - Dockerfile/requirements 變動時自動重建 Docker image - 部署通知: Telegram (開始/成功/失敗) - 健康檢查: https://mo.wooo.work/health (最多 5 次重試) - 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
import os
|
|
import sys
|
|
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker
|
|
|
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
sys.path.insert(0, BASE_DIR)
|
|
|
|
from database.models import Product
|
|
|
|
DB_PATH = os.path.join(BASE_DIR, 'data', 'momo_database.db')
|
|
engine = create_engine(f'sqlite:///{DB_PATH}')
|
|
Session = sessionmaker(bind=engine)
|
|
session = Session()
|
|
|
|
i_codes = ['5939587', '14713987', '14237189', '13759520', '13330513', '13731019',
|
|
'14049583', '14695038', '14373672', '13646926', '4633943', '6271461', '13559833']
|
|
|
|
print("🔍 驗證第二批商品的圖片 URL:\n")
|
|
print("=" * 100)
|
|
|
|
correct = 0
|
|
incorrect = 0
|
|
|
|
for i_code in i_codes:
|
|
product = session.query(Product).filter(Product.i_code == i_code).first()
|
|
if product:
|
|
print(f"\n[{i_code}] {product.name[:50]}...")
|
|
print(f" 圖片: {product.image_url}")
|
|
|
|
if product.image_url and i_code in product.image_url:
|
|
print(f" ✅ 正確: URL 包含商品編號")
|
|
correct += 1
|
|
else:
|
|
print(f" ❌ 錯誤: URL 不包含商品編號")
|
|
incorrect += 1
|
|
|
|
print("\n" + "=" * 100)
|
|
print(f"\n📊 驗證結果:")
|
|
print(f" ✅ 正確: {correct}/{len(i_codes)}")
|
|
print(f" ❌ 錯誤: {incorrect}/{len(i_codes)}")
|
|
|
|
session.close()
|