update
This commit is contained in:
parent
6848f78fac
commit
ad6481998d
@ -97,6 +97,17 @@ class AStockAPI:
|
||||
print(f"获取分钟线数据失败: {str(e)}")
|
||||
return pd.DataFrame()
|
||||
|
||||
@staticmethod
|
||||
def get_capital_flow(stock_code: str) -> pd.DataFrame:
|
||||
"""
|
||||
获取股票资金流向数据
|
||||
"""
|
||||
try:
|
||||
return adata.stock.market.get_capital_flow(stock_code=stock_code)
|
||||
except Exception as e:
|
||||
print(f"获取资金流向数据失败: {str(e)}")
|
||||
return pd.DataFrame()
|
||||
|
||||
@staticmethod
|
||||
def get_capital_flow_min(stock_code: str) -> pd.DataFrame:
|
||||
"""
|
||||
|
||||
@ -35,7 +35,7 @@ async def get_stock_data(stock_code: str):
|
||||
# result["min_data"] = json.loads(min_data.to_json(orient="records"))
|
||||
|
||||
# 获取资金流向数据
|
||||
flow_data = api.get_capital_flow_min(stock_code)
|
||||
flow_data = api.get_capital_flow(stock_code)
|
||||
result["flow_data"] = json.loads(flow_data.to_json(orient="records"))
|
||||
|
||||
return result
|
||||
|
||||
@ -29,7 +29,7 @@ services:
|
||||
cryptoai-api:
|
||||
build: .
|
||||
container_name: cryptoai-api
|
||||
image: cryptoai-api:0.0.16
|
||||
image: cryptoai-api:0.0.17
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user