Sketch endpoint "photo_points"

pull/6/head
gtitov 5 years ago
parent 1ba4ac1bd6
commit 085a3b11c0

@ -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
}
]
Loading…
Cancel
Save