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; } }
@Action( value = MY_INVITED, results = {@Result(name = SUCCESS, location = FOREPART + MY_INVITED + JSP)}) public String myInvited() { super.getRequestMap().put(MY_INVITED, clubService.myInvited(super.currentUser())); return SUCCESS; }
@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; }
@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; } }
// 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; }