Package com.freewebsys.sns.pojo

Examples of com.freewebsys.sns.pojo.UserInfo


  @Transactional
  public PageConf findFriendPageList(int start, int limit, Map map)
      throws FriendException {

    try {
      UserInfo userInfo = (UserInfo) map.get("userInfo");
      map.remove("userInfo");
      String hql = " select module from UserInfo module ";
      // 通用查询匹配
      Object[] values = CommonDaoUtil.commonQuery(map);
      hql += values[0].toString();
      // Object[]需要进行强制转换.
      PageConf pageConf = baseDao.findPage(start, limit, hql,
          (Object[]) values[1]);
      if (pageConf != null && pageConf.getData() != null) {
        List list = pageConf.getData();
        for (int i = 0; i < list.size(); i++) {
          UserInfo friendUser = (UserInfo) list.get(i);
          System.out.println(userInfo.getId() + "/"
              + friendUser.getId());
          String hql_2 = "select friend.status from Friend friend where friend.userId = ? and friend.friend.id = ? ";
          Integer status = (Integer) baseDao.findFirstOne(hql_2,
              userInfo.getId(), friendUser.getId());
          friendUser.setMyFriendState(status);
          System.out.println(status);
        }
      }
      return pageConf;
    } catch (Exception e) {
View Full Code Here


      boolean isFirst = true;
      for (String userId : userIds) {
        // 按照用户名称查询用户
        if (StringUtils.isNumeric(userId)) {// 判断是否是数字
          String hql = " from UserInfo module where module.id = ? ";
          UserInfo userInfo = (UserInfo) baseDao.findFirstOne(hql,
              new Integer(userId));
          if (userInfo != null) {// 如果用户存在就累加
            if (isFirst) {// 如果是第一个不添加','
              tempIds = userId;
              tempNames = userInfo.getName() + "";
              isFirst = false;
            } else {// 累加
              tempIds += "," + userId;
              tempNames += "," + userInfo.getName();
            }
          }
        }
      }
      return new String[] { tempIds, tempNames };
View Full Code Here

    int state = friendService.findIsFriend(getSessionUserInfo().getId(),
        friendId);
    if (state == -1) {
      friend = new Friend();
      // 帮定好友用户
      userInfo = new UserInfo();
      userInfo.setId(friendId);
      friend.setFriend(userInfo);
      // 设置我的Id
      friend.setUserId(getSessionUserInfo().getId());
      // 保存好友信息
View Full Code Here

  @Transactional
  public void saveFeed(Object obj) throws FeedException {
    try {
      HttpServletRequest request = (HttpServletRequest) ActionContext
          .getContext().get(ServletActionContext.HTTP_REQUEST);
      UserInfo userInfo = (UserInfo) request.getSession().getAttribute(
          UserInfo.USER_SESSION);
      // 调用内部类
      FeedServiceThread feedServiceThread = new FeedServiceThread(obj,
          userInfo);
      feedServiceThread.start();
View Full Code Here

  @Transactional
  public UserInfo saveUserRegister(UserInfo userInfo)
      throws UserInfoException {
    try {

      UserInfo userInfoTemp = findUserInfoByEmail(userInfo.getEmail());
      if (userInfoTemp != null) {// 已经保存的数据
        System.out.println("重复提交数据!" + userInfo.getEmail());
        return userInfoTemp;
      }
      userInfo.setPasswd(md5(userInfo.getPasswd()));// 将密码设置MD5加密
View Full Code Here

   */
  @Override
  public UserInfo saveActiveUser(String ac) {
    try {
      String hql = " from UserInfo userInfo where userInfo.activeCode = ? ";
      UserInfo userInfo = (UserInfo) baseDao.findFirstOne(hql, ac);
      if (userInfo != null) {
        userInfo.setActive(1);// 激活帐号
        baseDao.save(userInfo);
        // 成功激活帐号
      }
      return userInfo;
    } catch (Exception e) {
View Full Code Here

  /**
   * 用户登录
   */
  public String saveUserLogin() throws Exception {
    UserInfo userInfoTemp = userInfoService.findUserInfoByEmailPasswd(
        email, passwd);
    if (userInfoTemp != null) {
      if (userInfoTemp.getActive().intValue() == 0) {//用户未激活
        addActionError("用户未激活,请查收邮件并激活帐号。");
        return INPUT;
      }
      HttpServletRequest request = (HttpServletRequest) ActionContext
          .getContext().get(ServletActionContext.HTTP_REQUEST);
View Full Code Here

  /**
   * 检查用户email
   */
  public void checkUserEmail() throws Exception {
    HttpServletRequest request = ServletActionContext.getRequest();
    UserInfo userInfoTemp = userInfoService
        .findUserInfoByEmail((String) request
            .getParameter("userInfo_email_id"));
    if (userInfoTemp == null) {
      writeToPage("true");
    } else {
View Full Code Here

  /**
   * 保存注册信息
   */
  public String saveUserRegister() throws Exception {
    UserInfo userInfoTemp = userInfoService.saveUserRegister(userInfo);
    email = userInfoTemp.getEmail();
    return SUCCESS;
  }
View Full Code Here

  /**
   * 激活用户
   */
  public String activeUser() throws Exception {
    UserInfo userInfoTemp = userInfoService.saveActiveUser(ac);
    if (userInfoTemp == null) {
      addActionError("连接地址错误。");
    } else {
      addActionMessage("帐号激活成功!");
      email = userInfoTemp.getEmail();// 设置邮件
    }
    return SUCCESS;
  }
View Full Code Here

TOP

Related Classes of com.freewebsys.sns.pojo.UserInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.