20 lines
467 B
Python
20 lines
467 B
Python
from fastapi import APIRouter, Depends
|
|
|
|
from api.di import get_user_service
|
|
from api.schemas.user_schema import UserSchema
|
|
from api.service.user import UserService
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/users", response_model=list[UserSchema])
|
|
async def get_user_list(
|
|
user_service: UserService = Depends(get_user_service),
|
|
) -> list[UserSchema]:
|
|
return await user_service.get_all_users()
|
|
|
|
|
|
@router.get("/status")
|
|
def get_status():
|
|
return {"status": "OK"}
|