@ResponseBody
@RequestMapping(value="/board/read.do", method=RequestMethod.GET, produces="text/plain;charset=UTF-8")
public String read(@RequestParam(value="boardno") int boardno, HttpSession session){
int mno = (Integer)session.getAttribute("mno");
int reply_cnt = replytoProc.reply_cnt_up(boardno);
JSONObject obj = new JSONObject();
HashMap<String, Object> hashMap = new HashMap<String, Object>();
hashMap.put("boardno", boardno);
hashMap.put("mno", mno);
if(liketoProc.countbyLike(hashMap)==0) {
liketoProc.create(hashMap);
}
LiketoVO liketoVO = liketoProc.read(hashMap);
BoardVO boardVO = boardProc.read(boardno);
MemberVO memberVO = memberProc.read(mno);
obj.put("boardno", boardno);
obj.put("categoryno", boardVO.getCategoryno());
obj.put("mno", mno);
obj.put("mimg", memberVO.getMimg());
obj.put("mnick", memberVO.getMnick());
obj.put("title", boardVO.getTitle());
obj.put("content", boardVO.getContent());
obj.put("rdate", boardVO.getRdate().substring(0, 16));
obj.put("like_check", liketoVO.getLike_check()); // 회원별 좋아요 체크값
obj.put("like_cnt", boardVO.getLike_cnt());
obj.put("reply_cnt", reply_cnt);
obj.put("word", boardVO.getWord());
return obj.toJSONString();
}