diff --git a/.gitignore b/.gitignore index 6b638aa..35153a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ venv setiings.json -.vscode \ No newline at end of file +.vscode +__pycache__ \ No newline at end of file diff --git a/api_functions.py b/api_functions.py index 285d3ff..826800c 100644 --- a/api_functions.py +++ b/api_functions.py @@ -23,4 +23,4 @@ def isEnd(cur, trueChatID): elif m >= len(roles) - m: return "mafia" - return "" + return None diff --git a/app.py b/app.py index 5361a26..9fab54d 100644 --- a/app.py +++ b/app.py @@ -15,8 +15,8 @@ def action(): # put application's code here checkedUserID = data['CheckedUserID'] response = { - "killedUserId": "", - "isEndGame": "", + "killedUserId": None, + "isEndGame": None, "checkedRole": False } @@ -40,22 +40,17 @@ def action(): # put application's code here return jsonify(response), 200 -@app.route('/create_game', methods=["POST"]) +@app.route('/create_chat', methods=["POST"]) def create(): - TCI = request.json['chatID'] + tci = request.json['chatID'] cursor = db.connection.cursor() - db.query_ins_chat(TCI, cursor) - db.close(cursor) + db.query_ins_chat(tci, cursor) + return 'ok', 200 -@app.route('/start_game') +@app.route('/start_game', methods=["POST"]) def start(): # Команда принимает на вход - pass - - -@app.route('/action') -def action(): - pass + return '', 501 if __name__ == '__main__':