opisanie rzeczy i wgl

This commit is contained in:
Hubert Dwornik 2024-05-11 16:30:59 +02:00
parent aaed0c19e0
commit a7812d4037
2 changed files with 9 additions and 6 deletions

View File

@ -12,11 +12,13 @@ db_connector = None
def hello():
return jsonify({"response": "Hello there"}), 200
@app.route("/api/v3/get/<string:oauth_ID>/<string:username>", methods=["POST"])
def access_user(oauth_ID, username):
print(oauth_ID, username)
return jsonify({"status": "success"}), 200
#endpoint do wyciągania danych o userze
@app.route("/api/v3/get/<string:username>", methods=["GET"])
def access_user(username):
return jsonify({"us": "er"}), 200
#endpoint służący do zapisu danych nowostworzonego użytkownika, podajemy mu
#id z oautha oraz login
@app.route("/api/v3/add/<string:oauth_ID>/<string:username>", methods=["POST"])
def add_user(oauth_ID, username):
res = db_connector.search(tinydb.where('username') == username)
@ -28,7 +30,7 @@ def add_user(oauth_ID, username):
return jsonify({"status": "success"}), 200
#idk, czy zrobimy to w ten sposób, ale na wszelki w, route może pozostać, IG
#roboczy endpoint służący do wyciąganiu rekomendacji
@app.route("/api/v3/ai/<string:oauth_ID>", methods=["GET"])
def get_recommendations(oauth_ID):
#request od frontu na rekomendacje

View File

@ -1,2 +1,3 @@
tinydb==4.8.0
flask==3.0.3
flask==3.0.3
psycopg2==2.9.9