⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userinfo.java

📁 Italk吧简易论坛 基于struts+extjs+hibernate+spring+mysql开发。 /catch目录为系统截图 安装步骤: 1:安装MYSQL
💻 JAVA
字号:
package com.italk.ui;

import java.sql.Timestamp;

import org.apache.log4j.Logger;

import com.italk.util.StringUtil;
import com.italk.vo.AdvanceInfo;
import com.italk.vo.User;

public class UserInfo {
	private Logger log=Logger.getLogger("italk");
	private User user = null;

	private String userName = null;

	private String sex = null;

	private String password = null;

	private String email = null;

	private String registerTime = null;

	private String lastLogonTime = null;

	private String age = null;

	private String realName = null;

	private String nickName = null;

	private String website = null;

	private String photo = null;

	private String born = null;

	private String phone = null;

	private String qq = null;

	private String description = null;

	private String groupName = null;
	
	private String id=null;
	public UserInfo() {

	}

	public UserInfo(User u) {
		setUser(u);
	}

	private void user2UserInfo() {
		this.id=user.getId().longValue()+"";
		this.userName = user.getBaseInfo().getUserName();
		this.sex = user.getBaseInfo().getSex().charValue() + "";
		this.password = user.getBaseInfo().getPassword();
		this.email = user.getBaseInfo().getEmail();
		this.registerTime = StringUtil.dateToSimpleLocalString(new Timestamp(
				user.getBaseInfo().getRegisterTime().longValue()));
		
		AdvanceInfo ai = user.getAdvanceInfo();
		if (ai != null && ai.getAge() != null) {
			this.age = ai.getAge().intValue() + "";
		} else {
			age = "";
		}

		if (ai != null && ai.getRealName() != null) {
			this.realName = ai.getRealName();
		} else {
			realName = "";
		}

		if (ai != null && ai.getNickName() != null) {
			this.nickName = ai.getNickName();
		} else {
			nickName = "";
		}

		if (ai != null && ai.getWebsite() != null) {
			this.website = ai.getWebsite();
		} else {
			website = "";
		}

		if (ai != null && ai.getPhoto() != null && ai.getPhoto().length > 0) {
			this.photo = user.getBaseInfo().getUserName();
		} else {
			photo = "default";
		}

		if (ai != null && ai.getPhone() != null) {
			this.phone = ai.getPhone();
		} else {
			phone = "";
		}

		if (ai != null && ai.getQq() != null) {
			this.qq = ai.getQq();
		} else {
			qq = "";
		}

		if (ai != null && ai.getDescription() != null) {
			this.description = ai.getDescription();
		} else {
			description = "";
		}
		
		if(ai != null && ai.getBorn() != null) {
			this.born=StringUtil.LongToBorn(ai.getBorn());
		}
		log.debug("get group ");
		this.groupName=user.getGroup().getGroupName();
		log.debug("groupName:"+user.getGroup().getGroupName());
	}

	/**
	 * @return the age
	 */
	public String getAge() {
		return age;
	}

	/**
	 * @param age
	 *            the age to set
	 */
	public void setAge(String age) {
		this.age = age;
	}

	/**
	 * @return the born
	 */
	public String getBorn() {
		return born;
	}

	/**
	 * @param born
	 *            the born to set
	 */
	public void setBorn(String born) {
		this.born = born;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email
	 *            the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the lastLogonTime
	 */
	public String getLastLogonTime() {
		return lastLogonTime;
	}

	/**
	 * @param lastLogonTime
	 *            the lastLogonTime to set
	 */
	public void setLastLogonTime(String lastLogonTime) {
		this.lastLogonTime = lastLogonTime;
	}

	/**
	 * @return the nickName
	 */
	public String getNickName() {
		return nickName;
	}

	/**
	 * @param nickName
	 *            the nickName to set
	 */
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the phone
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * @param phone
	 *            the phone to set
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * @return the photo
	 */
	public String getPhoto() {
		return photo;
	}

	/**
	 * @param photo
	 *            the photo to set
	 */
	public void setPhoto(String photo) {
		this.photo = photo;
	}

	/**
	 * @return the qq
	 */
	public String getQq() {
		return qq;
	}

	/**
	 * @param qq
	 *            the qq to set
	 */
	public void setQq(String qq) {
		this.qq = qq;
	}

	/**
	 * @return the realName
	 */
	public String getRealName() {
		return realName;
	}

	/**
	 * @param realName
	 *            the realName to set
	 */
	public void setRealName(String realName) {
		this.realName = realName;
	}

	/**
	 * @return the registerTime
	 */
	public String getRegisterTime() {
		return registerTime;
	}

	/**
	 * @param registerTime
	 *            the registerTime to set
	 */
	public void setRegisterTime(String registerTime) {
		this.registerTime = registerTime;
	}

	/**
	 * @return the sex
	 */
	public String getSex() {
		return sex;
	}

	/**
	 * @param sex
	 *            the sex to set
	 */
	public void setSex(String sex) {
		this.sex = sex;
	}

	/**
	 * @return the userName
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * @param userName
	 *            the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * @return the website
	 */
	public String getWebsite() {
		return website;
	}

	/**
	 * @param website
	 *            the website to set
	 */
	public void setWebsite(String website) {
		this.website = website;
	}

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @param user
	 *            the user to set
	 */
	public void setUser(User user) {
		this.user = user;
		this.user2UserInfo();
	}

	/**
	 * @return the groupName
	 */
	public String getGroupName() {
		return groupName;
	}

	/**
	 * @param groupName the groupName to set
	 */
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -