package com.*.*.*.model;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 登录信息实体类
* <p/>
* Date: 2010-2-2
*
* @author *
* @version 1.0
*/
public class LoginInfo
{
private String loginName; //登录名称
private String loginPwd; //登录密码
private String userID; //用户的唯一标识
private String nickName; //用户昵称
private String contactPhone; //手机号码
private String email; //Email
private String registerTime; //注册时间
private String memberIcon; //图像ICON路径
private String experienceWorth; //经验值
private String status; //会员状态(0:已禁用;1:正常)
private int point; //积分
private int userLevel; //用户的身份级别
private Date lastLoginTime = new Date(); //登录时间
private String loginResult; //登录结果
private Map<String, Integer> rightsMap = new HashMap<String, Integer>();
public LoginInfo()
{
}
public LoginInfo(String userID)
{
this(userID, userID, "");
}
public LoginInfo(String loginName, String loginPwd)
{
this("", loginName, loginPwd);
}
public LoginInfo(String userID, String loginName, String nickName)
{
this.userID = userID;
this.loginName = loginName;
this.nickName = nickName;
}
/**
* 判断当前登陆的用户是否具有管理员权限
*
* @return boolean
*/
public boolean isAdmin()
{
return userLevel == 0;
}
public String getContactPhone()
{
return contactPhone;
}
public void setContactPhone(String contactPhone)
{
this.contactPhone = contactPhone;
}
public String getLoginPwd()
{
return loginPwd;
}
public void setLoginPwd(String loginPwd)
{
this.loginPwd = loginPwd;
}
public String getLoginName()
{
return loginName;
}
public void setLoginName(String loginName)
{
this.loginName = loginName;
}
public Date getLastLoginTime()
{
return lastLoginTime;
}
public int getUserLevel()
{
return userLevel;
}
public void setUserLevel(int userLevel)
{
this.userLevel = userLevel;
}
public void setLastLoginTime(Date lastLoginTime)
{
this.lastLoginTime = lastLoginTime;
}
/** @return the loginResult */
public String getLoginResult()
{
return loginResult;
}
/** @param loginResult the loginResult to set */
public void setLoginResult(String loginResult)
{
this.loginResult = loginResult;
}
public String getNickName()
{
return nickName;
}
public void setNickName(String nickName)
{
this.nickName = nickName;
}
public String getUserID()
{
return userID;
}
public void setUserID(String userID)
{
this.userID = userID;
}
public Map<String, Integer> getRightsMap()
{
return rightsMap;
}
public void setRightsMap(Map<String, Integer> rightsMap)
{
this.rightsMap = rightsMap;
}
public String getEmail()
{
return email;
}
public void setEmail(String email)
{
this.email = email;
}
public String getRegisterTime()
{
return registerTime;
}
public void setRegisterTime(String registerTime)
{
this.registerTime = registerTime;
}
public String getMemberIcon()
{
return memberIcon;
}
public void setMemberIcon(String memberIcon)
{
this.memberIcon = memberIcon;
}
public String getExperienceWorth()
{
return experienceWorth;
}
public void setExperienceWorth(String experienceWorth)
{
this.experienceWorth = experienceWorth;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public int getPoint()
{
return point;
}
public void setPoint(int point)
{
this.point = point;
}
/**
* Returns a string representation of the object. In general, the
* <code>toString</code> method returns a string that
* "textually represents" this object. The result should
* be a concise but informative representation that is easy for a
* person to read.
* It is recommended that all subclasses override this method.
* <p/>
* The <code>toString</code> method for class <code>Object</code>
* returns a string consisting of the name of the class of which the
* object is an instance, the at-sign character `<code>@</code>', and
* the unsigned hexadecimal representation of the hash code of the
* object. In other words, this method returns a string equal to the
* value of:
* <blockquote>
* <pre>
* getClass().getName() + '@' + Integer.toHexString(hashCode())
* </pre></blockquote>
*
* @return a string representation of the object.
*/
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("UserID:").append(this.userID);
sb.append(",UserName:").append(this.nickName);
sb.append(",LastLoginTime:").append(this.getLastLoginTime());
return sb.toString();
}
}
登录信息实体类
最新推荐文章于 2024-02-07 11:28:32 发布