Esempio n. 1
0
  @RequestMapping("/search")
  public ModelAndView Search(@RequestParam final String searchtext, HttpSession Session) {

    logger.info(
        "User " + (String) Session.getAttribute("userName") + " searched for " + searchtext);

    final List<TweetData> tweet_list = viewService.searchTweets(searchtext, 0, 10);
    final List<User> user_list = viewService.searchUsers(searchtext, 0, 10);

    return new ModelAndView("search") {
      {
        addObject("searchtext", searchtext);
        addObject("UserList", user_list);
        addObject("TweetList", tweet_list);
        addObject("UserListSize", user_list.size());
        addObject("TweetListSize", tweet_list.size());
      }
    };
  }
Esempio n. 2
0
 @RequestMapping(value = "/user/addToMentions.json", method = RequestMethod.POST)
 @ResponseBody
 public String addToMentions(@RequestParam int tweet_id, HttpServletRequest request) {
   String[] u_list = request.getParameterValues("u_list[]");
   return viewService.addToMentions(u_list, tweet_id);
 }
Esempio n. 3
0
 @RequestMapping(value = "/search/moreSearchUsers.json", method = RequestMethod.GET)
 @ResponseBody
 public List<User> moreSearchResultsUsers(
     @RequestParam String searchtext, @RequestParam int offset) {
   return viewService.searchUsers(searchtext, offset, 10);
 }