package com.ywt.domain.entity.center;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "sns_user_info")
public class SnsUserInfo{

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "id", insertable = false, nullable = false)
  private Integer id;

  @Column(name = "open_id")
  private String openId;

  /**
   * 用户Id
   */
  @Column(name = "user_id")
  private Integer userId;

  /**
   * 昵称
   */
  @Column(name = "nickname")
  private String nickname;

  /**
   * 性别
   */
  @Column(name = "sex")
  private Integer sex;

  /**
   * 省
   */
  @Column(name = "province")
  private String province;

  /**
   * 市
   */
  @Column(name = "city")
  private String city;

  /**
   * 区
   */
  @Column(name = "country")
  private String country;

  /**
   * 头像
   */
  @Column(name = "avatar")
  private String avatar;

  /**
   * 社交账户类型（1-微信）
   */
  @Column(name = "sns_type")
  private Integer snsType;

  /**
   * 访问token
   */
  @Column(name = "access_token")
  private String accessToken;

  /**
   * 过期时间
   */
  @Column(name = "expires_in")
  private Date expiresIn;

  /**
   * 刷新token
   */
  @Column(name = "refresh_token")
  private String refreshToken;

  /**
   * 状态（1-正常，2-解绑）
   */
  @Column(name = "status")
  private Integer status;

  /**
   * 添加时间
   */
  @Column(name = "create_time", nullable = false)
  private Date createTime;

  /**
   * 修改时间
   */
  @Column(name = "update_time")
  private Date updateTime;

  @Column(name = "union_id")
  private String unionId;

  /**
   * language
   */
  @Column(name = "language")
  private String language;

  /**
   * 用户特权信息，json 数组
   */
  @Column(name = "privilege")
  private String privilege;

  /**
   * 是否删除
   */
  @Column(name = "deleted")
  private Integer deleted;

  /**
   * 终端号
   */
  @Column(name = "terminal", nullable = false)
  private Integer terminal;

  public Integer getId() {
    return id;
  }

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

  public String getOpenId() {
    return openId;
  }

  public void setOpenId(String openId) {
    this.openId = openId;
  }

  /**
   * 用户Id
   */
  public Integer getUserId() {
    return userId;
  }

  /**
   * 用户Id
   */
  public void setUserId(Integer userId) {
    this.userId = userId;
  }

  /**
   * 昵称
   */
  public String getNickname() {
    return nickname;
  }

  /**
   * 昵称
   */
  public void setNickname(String nickname) {
    this.nickname = nickname;
  }

  /**
   * 性别
   */
  public Integer getSex() {
    return sex;
  }

  /**
   * 性别
   */
  public void setSex(Integer sex) {
    this.sex = sex;
  }

  /**
   * 省
   */
  public String getProvince() {
    return province;
  }

  /**
   * 省
   */
  public void setProvince(String province) {
    this.province = province;
  }

  /**
   * 市
   */
  public String getCity() {
    return city;
  }

  /**
   * 市
   */
  public void setCity(String city) {
    this.city = city;
  }

  /**
   * 区
   */
  public String getCountry() {
    return country;
  }

  /**
   * 区
   */
  public void setCountry(String country) {
    this.country = country;
  }

  /**
   * 头像
   */
  public String getAvatar() {
    return avatar;
  }

  /**
   * 头像
   */
  public void setAvatar(String avatar) {
    this.avatar = avatar;
  }

  /**
   * 社交账户类型（1-微信）
   */
  public Integer getSnsType() {
    return snsType;
  }

  /**
   * 社交账户类型（1-微信）
   */
  public void setSnsType(Integer snsType) {
    this.snsType = snsType;
  }

  /**
   * 访问token
   */
  public String getAccessToken() {
    return accessToken;
  }

  /**
   * 访问token
   */
  public void setAccessToken(String accessToken) {
    this.accessToken = accessToken;
  }

  /**
   * 过期时间
   */
  public Date getExpiresIn() {
    return expiresIn;
  }

  /**
   * 过期时间
   */
  public void setExpiresIn(Date expiresIn) {
    this.expiresIn = expiresIn;
  }

  /**
   * 刷新token
   */
  public String getRefreshToken() {
    return refreshToken;
  }

  /**
   * 刷新token
   */
  public void setRefreshToken(String refreshToken) {
    this.refreshToken = refreshToken;
  }

  /**
   * 状态（1-正常，2-解绑）
   */
  public Integer getStatus() {
    return status;
  }

  /**
   * 状态（1-正常，2-解绑）
   */
  public void setStatus(Integer status) {
    this.status = status;
  }

  /**
   * 添加时间
   */
  public Date getCreateTime() {
    return createTime;
  }

  /**
   * 添加时间
   */
  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  /**
   * 修改时间
   */
  public Date getUpdateTime() {
    return updateTime;
  }

  /**
   * 修改时间
   */
  public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
  }

  public String getUnionId() {
    return unionId;
  }

  public void setUnionId(String unionId) {
    this.unionId = unionId;
  }

  /**
   * language
   */
  public String getLanguage() {
    return language;
  }

  /**
   * language
   */
  public void setLanguage(String language) {
    this.language = language;
  }

  /**
   * 用户特权信息，json 数组
   */
  public String getPrivilege() {
    return privilege;
  }

  /**
   * 用户特权信息，json 数组
   */
  public void setPrivilege(String privilege) {
    this.privilege = privilege;
  }

  /**
   * 是否删除
   */
  public Integer getDeleted() {
    return deleted;
  }

  /**
   * 是否删除
   */
  public void setDeleted(Integer deleted) {
    this.deleted = deleted;
  }

  /**
   * 终端号
   */
  public Integer getTerminal() {
    return terminal;
  }

  /**
   * 终端号
   */
  public void setTerminal(Integer terminal) {
    this.terminal = terminal;
  }

  public String toString() {
    return "SnsUserInfo{id=" + id +
      ", openId=" + openId +
      ", userId=" + userId +
      ", nickname=" + nickname +
      ", sex=" + sex +
      ", province=" + province +
      ", city=" + city +
      ", country=" + country +
      ", avatar=" + avatar +
      ", snsType=" + snsType +
      ", accessToken=" + accessToken +
      ", expiresIn=" + expiresIn +
      ", refreshToken=" + refreshToken +
      ", status=" + status +
      ", createTime=" + createTime +
      ", updateTime=" + updateTime +
      ", unionId=" + unionId +
      ", language=" + language +
      ", privilege=" + privilege +
      ", deleted=" + deleted +
      ", terminal=" + terminal +
      "}";
  }
}