Пример #1
0
def API_V1_auth__withdrawal():
    process_time = time.time()
    if check_user(g.db, get_jwt_identity()):
        try:
            result = withdrawal(g.db, get_jwt_identity())
            status = "success"
        except:
            result = status = "fail"
    else:
        status = "success"
        result = "Access denied"
    process_time = time.time() - process_time
    return jsonify(API_STATUS=status, RESULT=result, PROCESS_TIME=process_time)
Пример #2
0
def API_V1_class_manage__get_admin_class():
    process_time = time.time()
    if check_user(g.db, get_jwt_identity()):
        try:
            result = get_admin_class(g.db, get_jwt_identity())
            status = "success"
        except:
            result = status = "fail"
    else:
        status = "success"
        result = "Access denied"
    process_time = time.time() - process_time
    return jsonify(API_STATUS=status, RESULT=result, PROCESS_TIME=process_time)
Пример #3
0
def API_V1_problem_manage__get_problem():
    process_time = time.time()
    p_id = request.get_json()['p_id']
    if check_user(g.db, get_jwt_identity()):
        try:
            result = get_problem(g.db, get_jwt_identity(), p_id)
            status = "success"
        except:
            result = status = "fail"
    else:
        status = "success"
        result = "Access denied"
    process_time = time.time() - process_time
    return jsonify(API_STATUS=status, RESULT=result, PROCESS_TIME=process_time)
Пример #4
0
def API_V1_auth__update():
    process_time = time.time()
    PW = request.get_json()['pw']
    CEHCK_PW = request.get_json()['check_pw']
    EMAIL = request.get_json()['email']
    if check_user(g.db, get_jwt_identity()):
        try:
            result = user_update(g.db, get_jwt_identity(), PW, CEHCK_PW, EMAIL)
            status = "success"
        except:
            result = status = "fail"
    else:
        result = "Access denied"
    process_time = time.time() - process_time
    return jsonify(API_STATUS=status, RESULT=result, PROCESS_TIME=process_time)
Пример #5
0
def API_V1_class_manage__get_classinfo():
    process_time = time.time()
    CLASS_ID = request.get_json()['class_id']
    if check_user(g.db, get_jwt_identity()):
        result = get_classinfo(g.db, CLASS_ID)
        try:
            result = get_classinfo(g.db, CLASS_ID)
            status = "success"
        except:
            result = status = "fail"
    else:
        status = "success"
        result = "Access denied"
    process_time = time.time() - process_time
    return jsonify(API_STATUS=status, RESULT=result, PROCESS_TIME=process_time)
Пример #6
0
def API_V1_problem_manage__execute():
    process_time = time.time()
    QUERY = request.get_json()['query']
    CLASS_ID = request.get_json()['class_id']
    if check_user(g.db, get_jwt_identity()):
        try:
            result = query_execute(g.db, g.testdb, QUERY, CLASS_ID)
            status = "success"
        except:
            result = status = "fail"
    else:
        status = "success"
        result = "Access denied"
    process_time = time.time() - process_time
    return jsonify(API_STATUS=status, RESULT=result, PROCESS_TIME=process_time)