package com.yonge.cooleshow.auth.api.entity;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 对应数据库表(sys_user):
 */
public class SysUser implements Serializable{

	/**
	 *
	 */
	private static final long serialVersionUID = -1374403507360017093L;

	/** 主键ID */
	private Long id;
	
	/** 用户名 */
	@ApiModelProperty(value = "用户名")
	private String username;

	/**  */
	@ApiModelProperty(value = "密码")
	private String password;

	/** 随机盐 */
	@ApiModelProperty(value = "随机盐")
	private String salt;

	@ApiModelProperty(value = "手机号")
	private String phone;

	/** 头像 */
	@ApiModelProperty(value = "头像")
	private String avatar;

	/** 创建时间 */
	private java.util.Date createTime;

	/** 修改时间 */
	private java.util.Date updateTime;

	/** 0-正常， 1-锁定 */
	@ApiModelProperty(value = "0-正常， 1-锁定")
	private Integer lockFlag;

	/** 0-正常，1-删除 */
	@ApiModelProperty(value = "0-正常，1-删除")
	private Boolean delFlag;

	/** 微信openid */
	@ApiModelProperty(value = "微信openid")
	private String wxOpenid;

	/** QQ openid */
	@ApiModelProperty(value = "QQ openid")
	private String qqOpenid;

	/** 用户类型 */
//	@ApiModelProperty(value = "用户类型")
	//STUDENT("学生"), EDU_TEACHER("教务老师"), TEACHER("指导老师"), SYSTEM("系统內置"), ADMIN("管理员")
	private String userType;

	@ApiModelProperty(value = "性别0女1男")
	private Integer gender;

	@ApiModelProperty(value = "民族")
	private String nation;

	@ApiModelProperty(value = "生日")
	private Date birthdate;

	@ApiModelProperty(value = "邮箱")
	private String email;

	@ApiModelProperty(value = "融云token")
	private String imToken;

	@ApiModelProperty(value = "身份证号")
	private String idCardNo;

	@ApiModelProperty(value = "真实姓名")
	private String realName;

	@ApiModelProperty(value = "微信号")
	private String wechatId;

	@ApiModelProperty(value = "是否是超管")
	private Boolean isSuperAdmin = false;

	@ApiModelProperty(value = "用户角色")
	private List<Long> roles;

	@ApiModelProperty(value = "最近一次修改用户名称时间")
	private Date lastUsernameTime;

	private String certificateType = "IDENTITY";

	public String getCertificateType() {
		return certificateType;
	}

	public void setCertificateType(String certificateType) {
		this.certificateType = certificateType;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getImToken() {
		return imToken;
	}

	public void setImToken(String imToken) {
		this.imToken = imToken;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUsername() {
		return this.username;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPassword() {
		return this.password;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getSalt() {
		return this.salt;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getAvatar() {
		return this.avatar;
	}

	public void setCreateTime(java.util.Date createTime) {
		this.createTime = createTime;
	}

	public java.util.Date getCreateTime() {
		return this.createTime;
	}

	public void setUpdateTime(java.util.Date updateTime) {
		this.updateTime = updateTime;
	}

	public java.util.Date getUpdateTime() {
		return this.updateTime;
	}

	public Integer getLockFlag() {
		return lockFlag;
	}

	public void setLockFlag(Integer lockFlag) {
		this.lockFlag = lockFlag;
	}

	public Boolean getSuperAdmin() {
		return isSuperAdmin;
	}

	public void setSuperAdmin(Boolean superAdmin) {
		isSuperAdmin = superAdmin;
	}

	public Boolean getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Boolean delFlag) {
		this.delFlag = delFlag;
	}

	public void setWxOpenid(String wxOpenid) {
		this.wxOpenid = wxOpenid;
	}

	public String getWxOpenid() {
		return this.wxOpenid;
	}

	public void setQqOpenid(String qqOpenid) {
		this.qqOpenid = qqOpenid;
	}

	public String getQqOpenid() {
		return this.qqOpenid;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		if(StringUtils.isNotEmpty(userType) && userType.startsWith(",")){
			userType = userType.substring(1);
		}
		this.userType = userType;
	}

	public Integer getGender() {
		return gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	public Date getBirthdate() {
		return birthdate;
	}

	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getIdCardNo() {
		return idCardNo;
	}

	public void setIdCardNo(String idCardNo) {
		this.idCardNo = idCardNo;
	}

	public String getWechatId() {
		return wechatId;
	}

	public void setWechatId(String wechatId) {
		this.wechatId = wechatId;
	}

	public Boolean getIsSuperAdmin() {
		return isSuperAdmin;
	}

	public void setIsSuperAdmin(Boolean isSuperAdmin) {
		this.isSuperAdmin = isSuperAdmin;
	}

	public List<Long> getRoles() {
		return roles;
	}

	public void setRoles(List<Long> roles) {
		this.roles = roles;
	}

	public Date getLastUsernameTime() {
		return lastUsernameTime;
	}

	public void setLastUsernameTime(Date lastUsernameTime) {
		this.lastUsernameTime = lastUsernameTime;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
