From e384c3dddf927b96d9931898ed421350ec884609 Mon Sep 17 00:00:00 2001 From: mengyxu Date: Fri, 7 Jan 2022 13:51:47 +0800 Subject: [PATCH] Update AjaxResponse.java --- .../vip/xumy/core/pojo/com/AjaxResponse.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/java/vip/xumy/core/pojo/com/AjaxResponse.java b/src/main/java/vip/xumy/core/pojo/com/AjaxResponse.java index 6b07618..55a96db 100644 --- a/src/main/java/vip/xumy/core/pojo/com/AjaxResponse.java +++ b/src/main/java/vip/xumy/core/pojo/com/AjaxResponse.java @@ -2,9 +2,8 @@ package vip.xumy.core.pojo.com; import lombok.Data; -/** All rights reserved - * author:mengyxu - * date:2019年6月26日 +/** + * All rights reserved author:mengyxu date:2019年6月26日 */ @Data @@ -17,7 +16,7 @@ public class AjaxResponse { this.success = success; this.message = message; } - + public AjaxResponse() { super(); } @@ -27,5 +26,21 @@ public class AjaxResponse { this.message = message; this.data = data; } + + public static AjaxResponse successed(String msg) { + return new AjaxResponse(true, msg); + } + + public static AjaxResponse failed(String msg) { + return new AjaxResponse(false, msg); + } + public static AjaxResponse successed() { + return new AjaxResponse(true, "操作成功"); + } + + public static AjaxResponse failed() { + return new AjaxResponse(false, "操作失败"); + } + }