27 lines
637 B
Python
27 lines
637 B
Python
"""HTTP adapters for business; business logic lives in services."""
|
|
|
|
from flask import Blueprint, request
|
|
|
|
from .. import business_service
|
|
|
|
bp = Blueprint('business', __name__)
|
|
|
|
@bp.route('/api/my_orders')
|
|
def my_orders():
|
|
return business_service.my_orders(request.args.get('phone', '').strip())
|
|
|
|
|
|
@bp.route('/api/ticket', methods=['POST'])
|
|
def add_ticket():
|
|
return business_service.add_ticket(request.get_json() or {})
|
|
|
|
|
|
@bp.route('/api/tickets')
|
|
def list_tickets():
|
|
return business_service.list_tickets()
|
|
|
|
|
|
@bp.route('/api/rate', methods=['POST'])
|
|
def rate_chat():
|
|
return business_service.rate_chat(request.json or {})
|