@@ -0,0 +1,1284 @@
+from .base import InformResponse%0Afrom .util import auto_response%0Afrom .util import error%0Afrom .util import is_error%0Afrom .util import is_fail%0Afrom .util import make_error%0Afrom .util import is_success%0A%0A%0A__all__ = %5B'is_error', 'is_success', 'is_fail', 'make_error'%5D%0A%0A%0Aclass Response(object):%0A    %22%22%22docstring for Response extension%22%22%22%0A%0A    def __init__(self, app=None):%0A%0A        if app:%0A            self.init_app(app)%0A%0A    def init_app(self, app):%0A        if not hasattr(app, 'response'):%0A            app.response = self%0A%0A        app.response_class = InformResponse%0A%0A    def success(self, data=%7B%7D, code=200, headers=None):%0A%0A        if not isinstance(data, dict):%0A            raise ValueError('data must be the dict type')%0A        return auto_response(%0A            body=%7B'status': 'success', 'data': data, 'code': code%7D,%0A            code=code, headers=headers)%0A%0A    def fail(self, data=%7B%7D, code=400, headers=None):%0A        if not isinstance(data, dict):%0A            raise ValueError('data must be the dict type')%0A        return auto_response(%0A            body=%7B'status': 'fail', 'data': data, 'code': code%7D,%0A            code=code, headers=headers)%0A%0A    def error(self, message='', code=None, data=None, headers=None):%0A        return error(message='', code=None, data=None, headers=None)%0A

Update app/extensions/response/__init__.py