25 lines
668 B
Python
25 lines
668 B
Python
from fastapi import FastAPI
|
|
from functinos import authorization, recalculation_events_func, get_random_event_func
|
|
from DB import UseDB
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/authorization")
|
|
async def root(login: str, password: str):
|
|
return authorization.authorization(login, password)
|
|
|
|
|
|
@app.get("/create_new_game")
|
|
async def root():
|
|
return UseDB("game").create_new_game()
|
|
|
|
|
|
@app.get("/recalculation_events")
|
|
async def recalculation_events(difficulty: str, well: bool):
|
|
return recalculation_events_func.recalculation_events_func(difficulty, well)
|
|
|
|
|
|
@app.get("/get_random_event")
|
|
async def get_random_event():
|
|
return get_random_event_func.get_random_event_func() |