Exemplo n.º 1
0
 @Action(
     value = CENTER,
     results = {@Result(name = SUCCESS, location = BaseAction.FOREPART + CENTER + JSP)})
 public String center() {
   /** ************************ TT ****************************************** */
   List<User> focusUserList =
       userService.getFocusList(User.class, (User) getSessionMap().get("user"));
   if (focusUserList.size() > 9) {
     focusUserList = focusUserList.subList(0, 9);
   }
   getRequestMap().put("focusUserList", focusUserList);
   List<Club> focusClubList =
       userService.getFocusList(Club.class, (User) getSessionMap().get("user"));
   if (focusClubList.size() > 9) {
     focusClubList = focusClubList.subList(0, 9);
   }
   getRequestMap().put("focusClubList", focusClubList);
   List<Merchant> focusMerchantList =
       userService.getFocusList(Merchant.class, (User) getSessionMap().get("user"));
   if (focusMerchantList.size() > 9) {
     focusMerchantList = focusMerchantList.subList(0, 9);
   }
   getRequestMap().put("focusMerchantList", focusMerchantList);
   super.getRequestMap().put("allUsers", userService.allUsers());
   user = (User) getSessionMap().get("user");
   /** ************************ 相册 ****************************************** */
   page = pictureService.getRelativeByHql(eachPageNumber, currentPage, totalPageNumber);
   pics = pictureService.findRelativePictureByHql(page);
   /** *********************** 相关说说 ****************************************** */
   page = talkingService.getRelativePageByHql(user, eachPageNumber, currentPage, 1);
   taks = talkingService.findRelativeTalkingByHql(page, user);
   return SUCCESS;
 }
Exemplo n.º 2
0
 @Action(
     value = UPDATE_USER,
     results = {@Result(name = SUCCESS, type = REDIRECT_ACTION, location = REFRESH_USER + MAIN)})
 public String updateUser() {
   if (portrait != null) {
     User currentUser = currentUser();
     userService.deleteOldPortraitPath(currentUser.getPortraitPath());
     fillPortraitPathToUser(currentUser.getName());
   }
   userService.update(user, portrait);
   return SUCCESS;
 }
Exemplo n.º 3
0
 @Action(
     value = REFRESH_USER + "*",
     results = {@Result(name = SUCCESS, type = REDIRECT_ACTION, location = "{1}")})
 public String refreshUser() {
   super.saveUser(userService.refresh(currentUser()));
   return SUCCESS;
 }
Exemplo n.º 4
0
 @Action(
     value = REGISTER,
     results = {
       @Result(
           name = SUCCESS,
           type = REDIRECT_ACTION,
           location = "emailLoginJsp",
           params = {"email", "${#request.email}"}),
       @Result(
           name = INPUT,
           type = REDIRECT_ACTION,
           location = REGISTER_INPUT,
           params = {"msg", "请正确输入信息!"}),
       @Result(name = ERROR, location = FOREPART + ERROR_PAGE)
     })
 public String register() {
   if (portrait != null) {
     fillPortraitPathToUser(user.getName());
   }
   String[] email = user.getEmail().split("@");
   if (email.length != 2) {
     return INPUT;
   }
   super.getRequestMap().put("email", email[1]);
   if (userService.register(user, portrait)) {
     if (mailService.sendRegisterLetter(user)) {
       return SUCCESS;
     } else {
       return ERROR;
     }
   } else {
     return INPUT;
   }
 }
Exemplo n.º 5
0
 private String login(UserStatus status) {
   super.clearSession();
   if ((user = userService.login(user, status)) != null) {
     // 将相关的用户id存入session
     super.saveUser(user);
     super.getSessionMap().put("relativeUsers", talkingService.preGetRelativeUserId(user));
     // 将相关的用户id存入session
     super.getSessionMap().put("relativeUsers", talkingService.preGetRelativeUserId(user));
     return SUCCESS;
   } else {
     return INPUT;
   }
 }
Exemplo n.º 6
0
 @Action(
     value = "myFocus",
     results = {@Result(name = SUCCESS, location = BaseAction.FOREPART + "myFocus.jsp")})
 public String myFocus() {
   // List<User> focusList = sessionUser.getUsersForTargetUserId();
   switch (type) {
     case (0):
       List<User> userList =
           userService.getFocusList(User.class, (User) getSessionMap().get("user"));
       getRequestMap().put("focusList", userList);
       // for(User u:userList){
       // checkList.add(u.getId());
       // }
       // getRequestMap().put("checkList", checkList);
       break;
     case (1):
       List<Club> clubList =
           userService.getFocusList(Club.class, (User) getSessionMap().get("user"));
       getRequestMap().put("focusList", clubList);
       // for(Club u:clubList){
       // checkList.add(u.getId());
       // }
       // getRequestMap().put("checkList", checkList);
       break;
     case (2):
       List<Merchant> merchantList =
           userService.getFocusList(Merchant.class, (User) getSessionMap().get("user"));
       getRequestMap().put("focusList", merchantList);
       // for(Merchant u:merchantList){
       // checkList.add(u.getId());
       // }
       // getRequestMap().put("checkList", checkList);
       break;
   }
   return SUCCESS;
 }
Exemplo n.º 7
0
 // main :userHome
 @Action(
     value = MAIN,
     results = {@Result(name = SUCCESS, location = BaseAction.FOREPART + MAIN + JSP)})
 public String home() {
   /** ************************ TT ****************************************** */
   List<User> focusUserList =
       userService.getFocusList(User.class, (User) getSessionMap().get("user"));
   if (focusUserList.size() > 9) {
     focusUserList = focusUserList.subList(0, 9);
   }
   getRequestMap().put("focusUserList", focusUserList);
   List<Club> focusClubList =
       userService.getFocusList(Club.class, (User) getSessionMap().get("user"));
   if (focusClubList.size() > 9) {
     focusClubList = focusClubList.subList(0, 9);
   }
   getRequestMap().put("focusClubList", focusClubList);
   List<Merchant> focusMerchantList =
       userService.getFocusList(Merchant.class, (User) getSessionMap().get("user"));
   if (focusMerchantList.size() > 9) {
     focusMerchantList = focusMerchantList.subList(0, 9);
   }
   getRequestMap().put("focusMerchantList", focusMerchantList);
   super.getRequestMap().put("allUsers", userService.allUsers());
   if (null == user || null == user.getId()) {
     user = (User) getSessionMap().get("user");
     user = userService.findById(user.getId());
   } else {
     user = userService.findById(user.getId());
   }
   /** ************************ 指定用户相册 ****************************************** */
   page = pictureService.getMyPageByHql(user, 1, currentPage, 1);
   pics = pictureService.findMyPictureByHql(page, user);
   /** ************************* 指定用户线上活动 **************************************** */
   page = onlineActivityService.getOneOnlineActivityPageByHql(4, currentPage, 1, null, null, user);
   onlineActs = onlineActivityService.findOneClubOnlineActivityByHql(page, null, null, user);
   /** ************************ 指定用户说说说说 ****************************************** */
   page = talkingService.getMyPageByHql(user, 10, currentPage, 1);
   taks = talkingService.findMyTalkingByHql(page, user);
   return SUCCESS;
 }