feat: balance and reward
This commit is contained in:
		
							
								
								
									
										23
									
								
								routes/balance.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								routes/balance.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
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
 | 
			
		||||
		Reference in New Issue
	
	Block a user