feat: 添加mock数据

This commit is contained in:
zdl
2025-12-09 11:34:07 +08:00
parent da2007386e
commit c704b12bce
2 changed files with 76 additions and 10 deletions

View File

@@ -212,4 +212,64 @@ export const companyHandlers = [
data: data.forecastReport || null
});
}),
// 14. 价值链关联公司
http.get('/api/company/value-chain/related-companies', async ({ request }) => {
await delay(300);
const url = new URL(request.url);
const nodeName = url.searchParams.get('node_name') || '';
console.log('[Mock] 获取价值链关联公司:', nodeName);
// 生成模拟的关联公司数据
const relatedCompanies = [
{
stock_code: '601318',
stock_name: '中国平安',
industry: '保险',
relation: '同业竞争',
market_cap: 9200,
change_pct: 1.25
},
{
stock_code: '600036',
stock_name: '招商银行',
industry: '银行',
relation: '核心供应商',
market_cap: 8500,
change_pct: 0.85
},
{
stock_code: '601166',
stock_name: '兴业银行',
industry: '银行',
relation: '同业竞争',
market_cap: 4200,
change_pct: -0.32
},
{
stock_code: '601398',
stock_name: '工商银行',
industry: '银行',
relation: '同业竞争',
market_cap: 15000,
change_pct: 0.15
},
{
stock_code: '601288',
stock_name: '农业银行',
industry: '银行',
relation: '同业竞争',
market_cap: 12000,
change_pct: -0.08
}
];
return HttpResponse.json({
success: true,
data: relatedCompanies,
node_name: nodeName
});
}),
];