service_man/api/router/user.py

22 lines
538 B
Python

from dependency_injector.wiring import Provide, inject
from fastapi import APIRouter, Depends
from api.di import Container
from api.schemas.user_schema import UserSchema
from api.service.user import UserService
router = APIRouter()
@router.get("/users", response_model=list[UserSchema])
@inject
async def get_user_list(
user_service: UserService = Depends(Provide[Container.user_service]),
) -> list[UserSchema]:
return await user_service.get_all_users()
@router.get("/status")
def get_status():
return {"status": "OK"}