def __init__(self): self.r = redis.Redis(host="127.0.0.1", port=6379, db=1) self.db = DatabaseManger()
from flask import Flask, render_template, redirect, request, jsonify, make_response, Response, session, Blueprint, current_app as app from flask_mail import Mail, Message from database.db_manager import DatabaseManger from database.db_game_manager import GameDataBaseManager from security.encryption_module import AESCipher from database.signup_cache_manager import RedisSignUpManager from database.login_cache_manager import RedisLoginManager from database.search_password_cache_manager import RedisSearchPasswordManager redis_sign_up_mng = RedisSignUpManager() redis_login_up_mng = RedisLoginManager() redis_search_password_mng = RedisSearchPasswordManager() db_game_mng = GameDataBaseManager() crypt = AESCipher() db_manage = DatabaseManger() blueprints = Blueprint('game_api', __name__) # 로비에 표현될 데이터 @blueprints.route("/get-data", methods=['POST', 'GET']) def get_user(): if request.method == 'POST': data = db_game_mng.get_user_data(request.form.get('id')) print(data) return jsonify({ "achievescore": data['achievescore'], "victory": data['victory'], "lose": data['lose'], "kill": data['kill'], "death": data['death'],