mirror of
https://github.com/IgorL123/mafia_api.git
synced 2026-09-23 23:20:19 +00:00
refactoring
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
venv
|
venv
|
||||||
setiings.json
|
setiings.json
|
||||||
.vscode
|
.vscode
|
||||||
|
__pycache__
|
||||||
+1
-1
@@ -23,4 +23,4 @@ def isEnd(cur, trueChatID):
|
|||||||
elif m >= len(roles) - m:
|
elif m >= len(roles) - m:
|
||||||
return "mafia"
|
return "mafia"
|
||||||
|
|
||||||
return ""
|
return None
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ def action(): # put application's code here
|
|||||||
checkedUserID = data['CheckedUserID']
|
checkedUserID = data['CheckedUserID']
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
"killedUserId": "",
|
"killedUserId": None,
|
||||||
"isEndGame": "",
|
"isEndGame": None,
|
||||||
"checkedRole": False
|
"checkedRole": False
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,22 +40,17 @@ def action(): # put application's code here
|
|||||||
return jsonify(response), 200
|
return jsonify(response), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/create_game', methods=["POST"])
|
@app.route('/create_chat', methods=["POST"])
|
||||||
def create():
|
def create():
|
||||||
TCI = request.json['chatID']
|
tci = request.json['chatID']
|
||||||
cursor = db.connection.cursor()
|
cursor = db.connection.cursor()
|
||||||
db.query_ins_chat(TCI, cursor)
|
db.query_ins_chat(tci, cursor)
|
||||||
db.close(cursor)
|
return 'ok', 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/start_game')
|
@app.route('/start_game', methods=["POST"])
|
||||||
def start(): # Команда принимает на вход
|
def start(): # Команда принимает на вход
|
||||||
pass
|
return '', 501
|
||||||
|
|
||||||
|
|
||||||
@app.route('/action')
|
|
||||||
def action():
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user