forked from polka_billy/porridger
Merge branch 'main' of https://github.com/dm1sh/porridger_tmp
This commit is contained in:
@ -193,6 +193,15 @@ def add_points(user_id: int):
|
||||
raise HTTPException(status_code=404, detail="Item not found")
|
||||
return {"rating": user.rating}
|
||||
|
||||
# Отправляем стихи
|
||||
@app.get("/api/user/poem") # пока не работает
|
||||
def poems_to_front(): # db: Annotated[Session, Depends(utils.get_db)]
|
||||
kolvo_stixov = 109 # пока количество стихотворений = 101
|
||||
rand_id = random.randint(1, kolvo_stixov) # номер стихотворения
|
||||
poem_json = dict()
|
||||
poem = database.query(models.Poems).filter(models.Poems.id == rand_id).first()
|
||||
poem_json = {"title": poem.title, "text": poem.text, "author":poem.author}
|
||||
return poem_json
|
||||
|
||||
@app.get("/api/trashbox", response_model=List[schemas.TrashboxResponse])
|
||||
def get_trashboxes(lat:float, lng:float):#крутая функция для работы с api
|
||||
|
Reference in New Issue
Block a user