From 18f30d8c1df9625f24ddea3ff60343e0c73dc5e8 Mon Sep 17 00:00:00 2001 From: mai-tao Date: Tue, 20 Oct 2020 09:27:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86comment=E5=92=8Cnoti?= =?UTF-8?q?ce=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/kunpeng/bean/CodeMsg.java | 4 ++-- app/src/main/java/kunpeng/controller/CommentController.java | 6 +++--- app/src/main/java/kunpeng/controller/NoticeController.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/kunpeng/bean/CodeMsg.java b/app/src/main/java/kunpeng/bean/CodeMsg.java index fa4cf71..818039c 100644 --- a/app/src/main/java/kunpeng/bean/CodeMsg.java +++ b/app/src/main/java/kunpeng/bean/CodeMsg.java @@ -196,7 +196,7 @@ public class CodeMsg { public static CodeMsg HOME_STUDENT_COMMENT_CONTENT_EMPTY = new CodeMsg(-50002,"评论内容为空!请输入内容!"); public static CodeMsg HOME_WRONG_STUDENT_NUMBER_FORMAT = new CodeMsg(-50003,"学号格式错误!"); public static CodeMsg BAD_ACTIVITYID_FORMAT = new CodeMsg(-50004,"活动号格式错误!"); - public static CodeMsg GET_COMMENTS_SUCCESSFULLY = new CodeMsg(-50100,"获取评论列表成功!"); + public static CodeMsg GET_COMMENTS_SUCCESSFULLY = new CodeMsg(-51000,"获取评论列表成功!"); public static CodeMsg GET_COMMENTS_EMPTY = new CodeMsg(-51001,"获取评论列表成功!但是没有相关记录!"); public static CodeMsg GET_COMMENTS_FAILED = new CodeMsg(-51002,"获取评论列表失败!"); public static CodeMsg DELETE_COMMENT_SUCCESSFULLY = new CodeMsg(-52000,"删除评论成功!"); @@ -208,7 +208,7 @@ public class CodeMsg { //后台管理员公告操作 public static CodeMsg ADD_NOTICE_SUCCESSFULLY = new CodeMsg(-53000,"添加公告成功!"); public static CodeMsg ADD_NOTICE_FAILED = new CodeMsg(-53001,"添加公告失败!"); - public static CodeMsg DELETE_NOTICE_SUCCESSFULLY = new CodeMsg(-54000,"添加公告成功!"); + public static CodeMsg DELETE_NOTICE_SUCCESSFULLY = new CodeMsg(-54000,"删除公告成功!"); public static CodeMsg DELETE_NOTICE_FAILED = new CodeMsg(-54001,"删除公告失败!"); public static CodeMsg UPDATE_NOTICE_SUCCESSFULLY = new CodeMsg(-55000,"更新公告成功!"); public static CodeMsg UPDATE_NOTICE_FAILED = new CodeMsg(-55001,"更新公告失败!"); diff --git a/app/src/main/java/kunpeng/controller/CommentController.java b/app/src/main/java/kunpeng/controller/CommentController.java index 6232eb7..d660b2b 100644 --- a/app/src/main/java/kunpeng/controller/CommentController.java +++ b/app/src/main/java/kunpeng/controller/CommentController.java @@ -50,18 +50,18 @@ public class CommentController { public Map getAllCommentsOfAnActivity(@RequestParam String actID){//获取单个活动的全部评论 Map resultMap = new HashMap<>(); if(!actID.matches(RegexUtil.IDRegex)){ - resultMap.put("code",CodeMsg.BAD_ACTIVITYID_FORMAT); + resultMap.put("code",CodeMsg.BAD_ACTIVITYID_FORMAT.getCode()); resultMap.put("comments",null); return resultMap; } try { List comments = commentService.getCommentByActivityID(Integer.valueOf(actID)); - resultMap.put("code",CodeMsg.GET_COMMENTS_SUCCESSFULLY); + resultMap.put("code",CodeMsg.GET_COMMENTS_SUCCESSFULLY.getCode()); resultMap.put("comments",comments); return resultMap; } catch (Exception e){ - resultMap.put("code",CodeMsg.UNKNOWN_ERROR); + resultMap.put("code",CodeMsg.UNKNOWN_ERROR.getCode()); resultMap.put("comments",null); return resultMap; } diff --git a/app/src/main/java/kunpeng/controller/NoticeController.java b/app/src/main/java/kunpeng/controller/NoticeController.java index 16fefe6..4a46739 100644 --- a/app/src/main/java/kunpeng/controller/NoticeController.java +++ b/app/src/main/java/kunpeng/controller/NoticeController.java @@ -89,11 +89,11 @@ public class NoticeController { Map resultMap = new HashMap<>(); try{ List notices = noticeService.getAllNotices(); - resultMap.put("code", notices.size() > 0 ? Result.success(CodeMsg.QUERY_NOTICE_SUCCESSFULLY) : Result.error(CodeMsg.QUERY_NOTICE_NOT_EXIST)); + resultMap.put("code", notices.size() > 0 ? Result.success(CodeMsg.QUERY_NOTICE_SUCCESSFULLY).getCode() : Result.error(CodeMsg.QUERY_NOTICE_NOT_EXIST).getCode()); resultMap.put("notices",notices); } catch (Exception e){ - resultMap.put("code", CodeMsg.UNKNOWN_ERROR); + resultMap.put("code", CodeMsg.UNKNOWN_ERROR.getCode()); resultMap.put("notices",null); } return resultMap; -- Gitee