12345678910111213141516171819202122232425262728 |
- from fastapi import APIRouter
- from fastapi import Depends, Body
- from sqlalchemy.orm import Session
- from app import schemas
- from app.common.security.auth import verify_users
- 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("/")
- @web_try()
- @sxtimeit
- def build_datax_json(param: schemas.DataXJsonParam=Body(
- examples = schemas.DataXJsonParam.Config.schema_extra['examples']
- ), token_data: schemas.TokenData = Depends(verify_users), db: Session = Depends(get_db)):
- return crud.generate_datax_json(db, param)
|