datax_json.py 745 B

12345678910111213141516171819202122232425262728
  1. from fastapi import APIRouter
  2. from fastapi import Depends, Body
  3. from sqlalchemy.orm import Session
  4. from app import schemas
  5. from app.common.security.auth import verify_users
  6. import app.crud as crud
  7. from utils.sx_time import sxtimeit
  8. from utils.sx_web import web_try
  9. from fastapi_pagination import Page, add_pagination, paginate, Params
  10. from app import get_db
  11. router = APIRouter(
  12. prefix="/jpt/datax",
  13. tags=["datax构建JSON"],
  14. )
  15. @router.post("/")
  16. @web_try()
  17. @sxtimeit
  18. def build_datax_json(param: schemas.DataXJsonParam=Body(
  19. examples = schemas.DataXJsonParam.Config.schema_extra['examples']
  20. ), token_data: schemas.TokenData = Depends(verify_users), db: Session = Depends(get_db)):
  21. return crud.generate_datax_json(db, param)