Exemplo n.º 1
0
 public void initCurrentUser() {
   Long userId = getCurrentUserId();
   if (userId != null) {
     UserDO user = userService.getUserById(userId);
     currentUser.set(user);
   }
 }
Exemplo n.º 2
0
 private void handleNewTermEvent(NewTermEvent event) {
   Long termId = event.getTermId();
   TermDO term = termService.findByPrimaryKey(termId);
   PageInfo page = new PageInfo();
   page.setPageSize(Integer.MAX_VALUE);
   page.setPageStart(0);
   List<UserDO> followers = userService.getFollowMeUsers(term.getCreatorId(), page);
   for (UserDO follower : followers) {
     TermRelationDO anu = new TermRelationDO();
     anu.setTermId(termId);
     anu.setRelatedId(follower.getId());
     anu.setRelatedType("User");
     anu.setRelation("FOLLOW");
     termService.createTermRelation(anu, follower.getId());
   }
 }