# backend/app/routers/people.py
from fastapi import APIRouter, Depends
from sqlmodel import Session, select

from ..db import get_session
from ..models import Person
from ..schemas import PersonOut

router = APIRouter()  # prefix 없음. main.py 에서 prefix="/api" 등록.


@router.get("/people", response_model=list[PersonOut])
def list_people(s: Session = Depends(get_session)):
    return s.exec(select(Person)).all()
