From 66798f135e7dd2f436723001501035df3494e121 Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Thu, 1 Jul 2021 14:57:17 +0300 Subject: [PATCH] initial commit --- main.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..7624b05 --- /dev/null +++ b/main.py @@ -0,0 +1,24 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/new_session") +async def new_session(): + # add session to the database + # return new session cookie + return {"session_id": 42} + + +@app.get("/next_picture/{session_id}") +async def next_picture(session_id: int): + # take not rated picture from the database + # do not insert anything in the database yet + # return this picture + pass + + +@app.get("/rate_picture/{session_id}/{picture_id}/{mark}") +async def rate_picture(session_id: int, picture_id: int, mark: int): + # add new mark to the session table + pass