fooder-api/fooder/view/diary.py

17 lines
370 B
Python
Raw Normal View History

2023-04-01 16:19:12 +02:00
from fastapi import APIRouter, Depends, Request
from ..model.diary import Diary
from ..controller.diary import GetDiary
from datetime import date
router = APIRouter(tags=["diary"])
2023-04-01 20:23:04 +02:00
@router.get("", response_model=Diary)
2023-04-01 16:19:12 +02:00
async def get_diary(
request: Request,
date: date,
controller: GetDiary = Depends(GetDiary),
):
return await controller.call(date)