@RequestMapping(value = "/mypage/managecmt.do", method = RequestMethod.GET, params = "cmd=remove") public String removeComment( @RequestParam("bid") int boardCodeId, @RequestParam("cid") int commentId, @RequestParam("aid") int articleId) throws Exception { String message = ""; boolean isComment = commentService.removeComment(commentId); boolean isCommentCount = articleService.updownCommentCount(articleId, Comment.COMMENT_COUNT_DOWN); message = (isComment) ? "success" : "fail"; // bid=%d&sz=%d pg return "redirect:/mypage/managecmt.do?bid=" + boardCodeId; }
@RequestMapping(value = "/mypage/managecmt.do", method = RequestMethod.GET) public ModelAndView viewManagecmt( @RequestParam(value = "bid", defaultValue = "0") int boardCodeId) { ModelAndView modelAndView = new ModelAndView("/mypage/managecmt"); List<CommentView> commentList; // 보드가 0일 경우는 대회 자료 공유임. if (boardCodeId != 0) commentList = commentService.findBoardComments(boardCodeId, Article.IS_NOT_SHARE); else commentList = commentService.findBoardComments(boardCodeId, Article.IS_SHARE); List<BoardCodeView> boardCodeList = articleService.findBoards(null, 0); modelAndView.addObject("boardCodeList", boardCodeList); modelAndView.addObject("commentList", commentList); modelAndView.addObject("subTitle", "덧글 관리"); modelAndView.addObject("mypageType", "managecmt"); return modelAndView; }