feat: 个股添加个股列表弹窗
This commit is contained in:
13
app.py
13
app.py
@@ -12284,13 +12284,20 @@ def get_daily_top_concepts():
|
||||
top_concepts = []
|
||||
|
||||
for concept in data.get('results', []):
|
||||
# 保持与 /concept-api/search 相同的字段结构
|
||||
top_concepts.append({
|
||||
'concept_id': concept.get('concept_id'),
|
||||
'concept_name': concept.get('concept'),
|
||||
'concept': concept.get('concept'), # 原始字段名
|
||||
'concept_name': concept.get('concept'), # 兼容旧字段名
|
||||
'description': concept.get('description'),
|
||||
'change_percent': concept.get('price_info', {}).get('avg_change_pct', 0),
|
||||
'stock_count': concept.get('stock_count', 0),
|
||||
'stocks': concept.get('stocks', [])[:5] # 只返回前5只股票
|
||||
'score': concept.get('score'),
|
||||
'match_type': concept.get('match_type'),
|
||||
'price_info': concept.get('price_info', {}), # 完整的价格信息
|
||||
'change_percent': concept.get('price_info', {}).get('avg_change_pct', 0), # 兼容旧字段
|
||||
'happened_times': concept.get('happened_times', []), # 历史触发时间
|
||||
'stocks': concept.get('stocks', []), # 返回完整股票列表
|
||||
'hot_score': concept.get('hot_score')
|
||||
})
|
||||
|
||||
# 格式化日期为 YYYY-MM-DD
|
||||
|
||||
Reference in New Issue
Block a user