From f7a0efdafb43b2f4bc54f833d8b17798ac8c6033 Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Thu, 1 Jul 2021 15:19:19 +0300 Subject: [PATCH] add: basic description to api calls --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 7624b05..d805ecd 100644 --- a/main.py +++ b/main.py @@ -5,6 +5,7 @@ app = FastAPI() @app.get("/new_session") async def new_session(): + """Start a new session""" # add session to the database # return new session cookie return {"session_id": 42} @@ -12,6 +13,7 @@ async def new_session(): @app.get("/next_picture/{session_id}") async def next_picture(session_id: int): + """Request new picture to rate.""" # take not rated picture from the database # do not insert anything in the database yet # return this picture @@ -20,5 +22,7 @@ async def next_picture(session_id: int): @app.get("/rate_picture/{session_id}/{picture_id}/{mark}") async def rate_picture(session_id: int, picture_id: int, mark: int): + """Submit a rating for the picture""" + # check if session is valid # add new mark to the session table pass