Exemple #1
0
  /**
   * 글 목록
   *
   * @param boardDomain
   * @param request
   * @return
   * @throws Exception
   */
  @RequestMapping(value = "/api" + Constants.URL_BOARD_LIST)
  public ModelAndView getBoardListView(BoardDomain boardDomain, HttpServletRequest request)
      throws Exception {
    ModelAndView mav = new ModelAndView("jsonView");

    int totSize = boardService.getTotBoardCount(boardDomain.getBoard_id());
    boardDomain.setPageSize(10);
    boardDomain.setTotalSize(totSize);

    List<BoardDomain> boardListDomain = boardService.getAllBoardList(boardDomain);

    mav.addObject("boardListDomain", boardListDomain);

    return mav;
  }
Exemple #2
0
  /**
   * 글 상세보기
   *
   * @param boardDomain
   * @param boardReplyDomain
   * @return
   * @throws Exception
   */
  @RequestMapping(value = "/api" + Constants.URL_BOARD_DETAIL)
  public ModelAndView getBoardDetailView(BoardDomain boardDomain, BoardReplyDomain boardReplyDomain)
      throws Exception {
    ModelAndView mav = new ModelAndView("jsonView");

    List<BoardFileDomain> boardFileListDomain = null;

    boardDomain = boardService.getBoardDetailById(boardDomain.getId());

    if (boardDomain.getHas_File().equals("YES"))
      boardFileListDomain = boardService.getBoardFileListById(boardDomain.getId());

    int totSize = boardService.getTotBoardReplyCount(boardDomain.getId());
    boardReplyDomain.setPageSize(5);
    boardReplyDomain.setTotalSize(totSize);
    boardReplyDomain.setNo(boardDomain.getId());

    List<BoardReplyDomain> boardReplyListDomain =
        boardService.getAllBoardReplyListById(boardReplyDomain);

    String tmpPassword = "******";

    for (BoardReplyDomain rd : boardReplyListDomain) {
      rd.setPassword(tmpPassword);
    }

    boardReplyDomain.setPassword(tmpPassword);
    boardDomain.setPassword(tmpPassword);

    mav.addObject("boardDomain", boardDomain);
    mav.addObject("boardFileListDomain", boardFileListDomain);
    mav.addObject("boardReplyListDomain", boardReplyListDomain);
    mav.addObject("boardReplyDomain", boardReplyDomain);

    return mav;
  }