indexstore/main.py

27 lines
652 B
Python
Raw Normal View History

2022-09-30 15:00:45 +08:00
from fastapi import FastAPI, Header, Depends
from Indicator import indicator
app = FastAPI()
# async def get_token_header(authorization: str = Header(...)):
# """
# 获取Token并验证
# :param authorization:
# :return: openid
# """
# token = authorization.split(' ')[-1] # 获取token
# openid = auth_token(token) # 验证token
# if not openid:
# raise HTTPException(status_code=400, detail="无效Token")
2022-10-09 10:31:00 +08:00
# 路由
2022-09-30 15:00:45 +08:00
app.include_router(
indicator.router,
2022-10-09 10:31:00 +08:00
prefix="/api/001/indicator_storehouse",
2022-09-30 15:00:45 +08:00
# dependencies=[Depends(get_token_header)],
responses={404: {"description": "Not found"}},
)