This commit is contained in:
aaron 2025-05-15 08:55:51 +08:00
parent e148797850
commit 59efc06b99
3 changed files with 17 additions and 1 deletions

View File

@ -23,6 +23,17 @@ class AStockAPI:
return []
@staticmethod
def get_mine_clearance_tdx(stock_code: str) -> pd.DataFrame:
"""
获取股票扫雷避险信息
"""
try:
return adata.sentiment.mine.mine_clearance_tdx(stock_code=stock_code)
except Exception as e:
print(f"获取情绪数据失败: {str(e)}")
return []
@staticmethod
def get_concept_east(stock_code: str) -> pd.DataFrame:
"""

View File

@ -70,6 +70,11 @@ async def get_stock_data(stock_code: str):
flow_data = api.get_capital_flow(stock_code, start_date, end_date)
result["flow_data"] = json.loads(flow_data.to_json(orient="records"))
# 获取扫雷避险数据
mine_clearance = api.get_mine_clearance_tdx(stock_code)
result["mine_clearance"] = json.loads(mine_clearance.to_json(orient="records"))
except Exception as e:
logger.error(f"获取股票数据失败: {e}")
return {}

View File

@ -29,7 +29,7 @@ services:
cryptoai-api:
build: .
container_name: cryptoai-api
image: cryptoai-api:0.0.22
image: cryptoai-api:0.0.23
restart: always
ports:
- "8000:8000"