feat(phase1): OpenRouter采集器接入PostgreSQL,数据链路闭环

- 将 fetch_openrouter.go 的 summarize() 实现为 PostgreSQL upsert
- 新增 -db 参数和 DATABASE_URL 环境变量支持
- 打通 models + model_prices 表的最小可运行链路
- 创建 llm_intelligence 数据库并运行 migration
- 前端 Explorer 验证 T-3.2~T-3.5 全部通过
- 日报生成器正常产出 Markdown 和 latest_models.json
This commit is contained in:
Your Name
2026-05-08 13:49:12 +08:00
parent dbdf13ea42
commit ba054f04cf
37 changed files with 4617 additions and 0 deletions

47
scripts/verify_t32.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
# verify_t32.sh — 验收 T-3.2:表格渲染、免费标签、图表占位区块
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
FILE="$PROJECT_ROOT/frontend/src/pages/Explorer.tsx"
echo "=== T-3.2 验收检查 ==="
# T-3.2.3: 表格渲染(价格列 + isFree 列)
if grep -q 'inputPrice.*MT' "$FILE" && \
grep -q 'badge bg-success' "$FILE"; then
echo "table PASS — inputPrice 和 isFree badge 同时存在"
else
echo "table FAIL"
exit 1
fi
# T-3.2.2: 卡片视图价格 + 免费标签
if grep -q 'inputPrice.*MT.*outputPrice' "$FILE"; then
echo "badge PASS — 卡片价格渲染存在"
else
echo "badge FAIL"
exit 1
fi
# T-3.2.4a: 必须保持为合法 React 占位实现
if grep -q '<script' "$FILE" || \
grep -q 'dangerouslySetInnerHTML' "$FILE" || \
grep -q 'style="' "$FILE"; then
echo "react FAIL — 发现组件内 script / dangerouslySetInnerHTML / 非法 style 字符串"
exit 1
else
echo "react PASS — 未发现明显无效的 React 占位实现"
fi
# T-3.2.4: 价格趋势占位图区块
if grep -q 'price-trend-chart' "$FILE"; then
echo "chart PASS — price-trend-chart 占位区块存在"
else
echo "chart FAIL"
exit 1
fi
echo ""
echo "all PASS"
exit 0