diff --git a/sysom_server/sysom_migration/lib/response.py b/sysom_server/sysom_migration/lib/response.py index 2af8a296a71acad060047aacff547da355085d43..371de37c532728543daecf6e3b1edc9a770c09c4 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)