from flask import request, Response, send_file
from flask.views import MethodView as HTTPMethodView
import json
import xmltodict
import io


def json_response(body: dict, headers=None):
    """ 返回json """
    data = json.dumps(body, ensure_ascii=False, sort_keys=True)
    return Response(data, content_type='application/json', headers=headers)


def xml_response(body: dict, headers=None):
    """ 返回xml """
    data = xmltodict.unparse(body)
    return Response(data, content_type='text/xml', headers=headers)


class ServerError(Exception):
    pass

3d490aff2e164434776de596274382d007e1d172
<mask token>

<mask token>


class ServerError(Exception):
    pass

<mask token>


def json_response(body: dict, headers=None):
    """ 返回json """
    data = json.dumps(body, ensure_ascii=False, sort_keys=True)
    return Response(data, content_type='application/json', headers=headers)


<mask token>


class ServerError(Exception):
    pass

<mask token>


def json_response(body: dict, headers=None):
    """ 返回json """
    data = json.dumps(body, ensure_ascii=False, sort_keys=True)
    return Response(data, content_type='application/json', headers=headers)


def xml_response(body: dict, headers=None):
    """ 返回xml """
    data = xmltodict.unparse(body)
    return Response(data, content_type='text/xml', headers=headers)


class ServerError(Exception):
    pass

from flask import request, Response, send_file
from flask.views import MethodView as HTTPMethodView
import json
import xmltodict
import io


def json_response(body: dict, headers=None):
    """ 返回json """
    data = json.dumps(body, ensure_ascii=False, sort_keys=True)
    return Response(data, content_type='application/json', headers=headers)


def xml_response(body: dict, headers=None):
    """ 返回xml """
    data = xmltodict.unparse(body)
    return Response(data, content_type='text/xml', headers=headers)


class ServerError(Exception):
    pass
