24 lines
		
	
	
		
			652 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			652 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from flask import Blueprint, request
 | 
						|
from flask_jwt_extended import get_jwt_identity
 | 
						|
from routes.utils import jwt_protect_blueprint
 | 
						|
 | 
						|
import queries.balance.api as api
 | 
						|
 | 
						|
balance_blueprint = jwt_protect_blueprint(Blueprint('balance', __name__))
 | 
						|
 | 
						|
 | 
						|
@balance_blueprint.get('/transactions')
 | 
						|
def get_transactions():
 | 
						|
    data = dict(request.args)
 | 
						|
    if 'user_id' not in data:
 | 
						|
        data['user_id'] = get_jwt_identity()
 | 
						|
    response = api.get_balance_transactions(dict(data))
 | 
						|
    return response
 | 
						|
 | 
						|
 | 
						|
@balance_blueprint.get('/info')
 | 
						|
def get_balance_info():
 | 
						|
    data = {'user_id': get_jwt_identity()}
 | 
						|
    response = api.get_balance_info(data)
 | 
						|
    return response
 |