From 085a3b11c08756022b98d922fe39f854b2a95a7c Mon Sep 17 00:00:00 2001 From: gtitov Date: Wed, 15 Sep 2021 23:33:47 +0300 Subject: [PATCH] Sketch endpoint "photo_points" --- main.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/main.py b/main.py index c102c24..d687b51 100644 --- a/main.py +++ b/main.py @@ -144,3 +144,37 @@ async def rate_picture(cookie: str, picture_id: int, mark: int): return JSONResponse(status_code=406) return {"status": "success"} + +@app.get("/photo_points") +def photo_points(): + """Get points with the url of a photo and the rate""" + return [ + { + "id": 0, + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/JPEG_example_down.jpg/350px-JPEG_example_down.jpg", + "lon": 37.34542, + "lat": 55.12323, + "rate": 36 # percentage of likes + }, + { + "id": 1, + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/JPEG_example_down.jpg/350px-JPEG_example_down.jpg", + "lon": 37.34342, + "lat": 55.12423, + "rate": 62 # percentage of likes + }, + { + "id": 2, + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/JPEG_example_down.jpg/350px-JPEG_example_down.jpg", + "lon": 37.34642, + "lat": 55.12223, + "rate": 43 # percentage of likes + }, + { + "id": 3, + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/JPEG_example_down.jpg/350px-JPEG_example_down.jpg", + "lon": 37.34342, + "lat": 55.12923, + "rate": 90 # percentage of likes + } + ] \ No newline at end of file