From 1d382d52d02f5fa5976efa0557b64e675d96bd8d Mon Sep 17 00:00:00 2001 From: xinhaitao Date: Wed, 2 Aug 2023 15:50:07 +0800 Subject: [PATCH] =?UTF-8?q?sysom-migration=E6=A8=A1=E5=9D=97respone?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E8=BF=94=E5=9B=9E=E6=A0=BC=E5=BC=8F=E4=B8=8D?= =?UTF-8?q?=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xinhaitao --- sysom_server/sysom_migration/lib/response.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sysom_server/sysom_migration/lib/response.py b/sysom_server/sysom_migration/lib/response.py index 2af8a296..371de37c 100644 --- a/sysom_server/sysom_migration/lib/response.py +++ b/sysom_server/sysom_migration/lib/response.py @@ -7,10 +7,10 @@ def _response(data=None, status=None): return Response(data=data, status=status) -def success(result=None, msg="success", success=True, code=status.HTTP_200_OK, **kwargs): +def success(result=None, message="success", success=True, code=status.HTTP_200_OK, **kwargs): data = { "code": code, - "msg": msg, + "message": message, "data": result, "success": success } @@ -18,29 +18,29 @@ def success(result=None, msg="success", success=True, code=status.HTTP_200_OK, * return _response(data=data, status=code) -def not_found(code=status.HTTP_404_NOT_FOUND, success=False, msg="Not Found"): +def not_found(code=status.HTTP_404_NOT_FOUND, success=False, message="Not Found"): data = { "code": code, - "msg": msg, + "message": message, "success": success, } return _response(data=data, status=code) -def not_permission(code=status.HTTP_403_FORBIDDEN, success=False, msg="Not Permission"): +def not_permission(code=status.HTTP_403_FORBIDDEN, success=False, message="Not Permission"): data = { "code": code, "success": success, - "msg": msg + "message": message } return _response(data=data, status=code) -def other_response(result=dict(), msg="", success=True, code=status.HTTP_200_OK, **kwargs): +def other_response(result=dict(), message="", success=True, code=status.HTTP_200_OK, **kwargs): data = { "code": code, - "msg": msg, + "message": message, "data": result, "success": success } @@ -59,7 +59,7 @@ class ErrorResponse(Response): std_data = { "code": code, "data": data or {}, - "msg": msg + "message": msg } super().__init__(std_data, status, template_name, headers, exception, content_type) -- Gitee