From a37433075b68bf57e94b886a8df2779bf07f5ad6 Mon Sep 17 00:00:00 2001 From: mai-tao Date: Mon, 19 Oct 2020 22:31:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86Activity=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/kunpeng/controller/ActivityController.java | 8 ++++---- .../main/java/kunpeng/controller/CommentController.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/kunpeng/controller/ActivityController.java b/app/src/main/java/kunpeng/controller/ActivityController.java index 582d6e8..820df1f 100644 --- a/app/src/main/java/kunpeng/controller/ActivityController.java +++ b/app/src/main/java/kunpeng/controller/ActivityController.java @@ -91,12 +91,12 @@ public class ActivityController { public Map getAllActivities(){ Map resultMap = new HashMap<>(); try{ - List notices = activityService.getAllActivities(); - resultMap.put("code", notices.size() > 0 ? Result.success(CodeMsg.QUERY_ACTIVITY_SUCCESSFULLY) : Result.error(CodeMsg.QUERY_ACTIVITY_NOT_EXIST)); - resultMap.put("notices",notices); + List activities = activityService.getAllActivities(); + resultMap.put("code", activities.size() > 0 ? Result.success(CodeMsg.QUERY_ACTIVITY_SUCCESSFULLY).getCode() : Result.error(CodeMsg.QUERY_ACTIVITY_NOT_EXIST).getCode()); + resultMap.put("activities",activities); } catch (Exception e){ - resultMap.put("code", CodeMsg.UNKNOWN_ERROR); + resultMap.put("code", CodeMsg.UNKNOWN_ERROR.getCode()); resultMap.put("notices",null); throw e; } diff --git a/app/src/main/java/kunpeng/controller/CommentController.java b/app/src/main/java/kunpeng/controller/CommentController.java index a9cd969..6232eb7 100644 --- a/app/src/main/java/kunpeng/controller/CommentController.java +++ b/app/src/main/java/kunpeng/controller/CommentController.java @@ -95,12 +95,12 @@ public class CommentController { Map resultMap = new HashMap<>(); try { List comments = commentService.getAllComments(); - resultMap.put("code", comments.size() == 0 ? Result.success(CodeMsg.GET_COMMENTS_EMPTY) : Result.success(CodeMsg.GET_COMMENTS_SUCCESSFULLY)); + resultMap.put("code", comments.size() == 0 ? Result.success(CodeMsg.GET_COMMENTS_EMPTY).getCode() : Result.success(CodeMsg.GET_COMMENTS_SUCCESSFULLY).getCode()); resultMap.put("comments",comments); return resultMap; } catch (Exception e){ - resultMap.put("code",Result.error(CodeMsg.GET_COMMENTS_FAILED)); + resultMap.put("code",Result.error(CodeMsg.GET_COMMENTS_FAILED).getCode()); resultMap.put("comments",null); return resultMap; } -- Gitee