from fastapi import APIRouter from fastapi import Depends, Body from sqlalchemy.orm import Session from app import schemas from app.common.decorators import verify_all import app.crud as crud from utils.sx_time import sxtimeit from utils.sx_web import web_try from fastapi_pagination import Page, add_pagination, paginate, Params from app import get_db router = APIRouter( prefix="/jpt/datax", tags=["datax构建JSON"], ) @router.post("/", dependencies=[Depends(verify_all)]) @web_try() @sxtimeit def build_datax_json(param: schemas.DataXJsonParam=Body( examples = schemas.DataXJsonParam.Config.schema_extra['examples'] ), db: Session = Depends(get_db)): print(param) return crud.generate_datax_json(db, param)