18 lines
513 B
Python
18 lines
513 B
Python
# Entity: TestData
|
|
|
|
from fastapi import APIRouter, Depends, HTTPException, status
|
|
from sqlalchemy.orm import Session
|
|
from typing import List
|
|
from core.database import get_db
|
|
from models.test_data import TestData
|
|
from schemas.test_data import TestDataSchema
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/test-ai", status_code=200, response_model=List[TestDataSchema])
|
|
async def get_all_test_data(
|
|
db: Session = Depends(get_db)
|
|
):
|
|
"""Get all test data"""
|
|
test_data = db.query(TestData).all()
|
|
return test_data |