@RequestMapping(value = "/toLoadComments.do", method = RequestMethod.GET) public @ResponseBody List<Comment> toLoadComments(@RequestParam("matchid") int matchid) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); MatchCommentDao dao = (MatchCommentDao) context.getBean("MatchCommentDao"); List<Comment> commentList = dao.doLoadComments(matchid); return commentList; }
@RequestMapping(value = "/toListenNewComments.do", method = RequestMethod.GET) public @ResponseBody List<CommentHasPts> toListenNewComments( @RequestParam("matchid") int matchid, @RequestParam("latestTimeStamp") Long latestTimeStamp) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); MatchCommentDao dao = (MatchCommentDao) context.getBean("MatchCommentDao"); List<CommentHasPts> commentList = dao.toListenNewComments(matchid, latestTimeStamp); return commentList; }
@RequestMapping(value = "/toComment.do", method = RequestMethod.POST) public @ResponseBody String toComment( @RequestParam("matchid") String matchid, @RequestParam("style") String style, @RequestParam("tempo") String tempo, @RequestParam("intensity") String intensity, @RequestParam("description") String description) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); MatchCommentDao dao = (MatchCommentDao) context.getBean("MatchCommentDao"); dao.doPostComment(matchid, style, tempo, intensity, description); return "success"; }