This commit is contained in:
aaron 2025-05-17 21:17:45 +08:00
parent f21c4039f7
commit e3a4cd281a
2 changed files with 6 additions and 4 deletions

View File

@ -57,13 +57,15 @@ async def get_stock_base(stock_code: str):
return result
@router.get("/stock/data", summary="获取股票数据")
async def get_stock_data(stock_code: str):
async def get_stock_data(stock_code: str, start_date: Optional[str] = None, end_date: Optional[str] = None):
api = AStockAPI()
result = {}
try:
if start_date is None:
start_date = "2025-01-01"
if end_date is None:
end_date = datetime.now().strftime("%Y-%m-%d")
# 获取市场数据

View File

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