コード例 #1
0
  @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;
  }
コード例 #2
0
  @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;
  }
コード例 #3
0
  @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";
  }