Пример #1
0
  public Collection<Tweet> getUserlineRange(String login, String startTweetId, int count)
      throws FunctionalException {
    User user = this.userService.getUserByLogin(login);
    User currentUser = this.userService.getCurrentUser();
    if (user == null) {
      return Arrays.asList();
    }

    if (startTweetId == null && count < TatamiConstants.DEFAULT_TWEET_LIST_SIZE) {
      count = TatamiConstants.DEFAULT_TWEET_LIST_SIZE;
    }

    Collection<String> tweetIds =
        userLineRepository.getTweetsRangeFromUserline(user, startTweetId, count);

    return this.buildTweetsList(currentUser, tweetIds);
  }
Пример #2
0
 @Override
 public void onTweetPost(Tweet tweet) {
   User currentUser = userService.getCurrentUser();
   userLineRepository.addTweetToUserline(currentUser, tweet.getTweetId());
 }