修改数据获取方式

This commit is contained in:
cheney
2026-08-06 14:00:11 +08:00
parent 4da9489662
commit b10b1c44db
11 changed files with 615 additions and 31 deletions
+3 -26
View File
@@ -92,32 +92,9 @@ async function main() {
}
console.log('[Strategy] upsert 策略: ' + n2 + ' 行 (1=新增, 2=更新)');
const indicators = [
{ name: 'china-bond-1y', groupName: 'china-bond',
data: { unit: '%', title: '中国国债1年', rows: [
{ month: '2024-01', value: 1.85 }, { month: '2024-02', value: 1.82 },
{ month: '2024-03', value: 1.78 }, { month: '2024-04', value: 1.75 },
{ month: '2024-05', value: 1.72 }, { month: '2024-06', value: 1.68 },
]}},
{ name: 'china-bond-10y', groupName: 'china-bond',
data: { unit: '%', title: '中国国债10年', rows: [
{ month: '2024-01', value: 2.65 }, { month: '2024-02', value: 2.62 },
{ month: '2024-03', value: 2.58 }, { month: '2024-04', value: 2.55 },
{ month: '2024-05', value: 2.52 }, { month: '2024-06', value: 2.48 },
]}},
{ name: 'us-bond-1y', groupName: 'us-bond',
data: { unit: '%', title: '美国国债1年', rows: [
{ month: '2024-01', value: 4.85 }, { month: '2024-02', value: 4.82 },
{ month: '2024-03', value: 4.78 }, { month: '2024-04', value: 4.65 },
{ month: '2024-05', value: 4.55 }, { month: '2024-06', value: 4.45 },
]}},
{ name: 'china-lpr-1y', groupName: 'china-lpr',
data: { unit: '%', title: '中国LPR 1年期', rows: [
{ month: '2024-01', value: 3.45 }, { month: '2024-02', value: 3.45 },
{ month: '2024-03', value: 3.45 }, { month: '2024-04', value: 3.40 },
{ month: '2024-05', value: 3.40 }, { month: '2024-06', value: 3.40 },
]}},
];
// Indicator 表: 改由 scripts/refresh-indicators.cjs 从 World Bank API 拉取最新数据
// 旧 4 个金融指标 (国债/LPR) 无稳定 JSON 数据源, 暂不维护
const indicators = [];
let n3 = 0;
for (const i of indicators) {
n3 += await upsertByName(conn, 'Indicator',