21 lines
714 B
Python
21 lines
714 B
Python
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter, Header, HTTPException
|
|
|
|
from app.schemas.feishu_external import FeishuExternalQueryRequest
|
|
from app.services.feishu_service import FeishuService
|
|
from app.services.huobanyun_service import HuobanyunService
|
|
|
|
router = APIRouter()
|
|
feishu_service = FeishuService()
|
|
huobanyun_service = HuobanyunService()
|
|
|
|
|
|
@router.post("/feishu/approval/external-data/query")
|
|
async def feishu_external_query(
|
|
req: FeishuExternalQueryRequest, x_feishu_token: str | None = Header(default=None)
|
|
):
|
|
if not feishu_service.verify_token(x_feishu_token):
|
|
raise HTTPException(status_code=403, detail="invalid token")
|
|
return await huobanyun_service.query(req)
|