package com.qianwen.mdc.domain;
|
|
import java.io.Serializable;
|
import java.util.Date;
|
//import javax.persistence.*;
|
|
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
/**
|
* 用户登陆token数据
|
*/
|
@TableName("account_token")
|
public class AccountToken implements Serializable {
|
/**
|
* primary key
|
*/
|
//@Id
|
//@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@TableId(type=IdType.AUTO)
|
private Integer id;
|
|
/**
|
*
|
*/
|
private Integer userId;
|
|
/**
|
*
|
*/
|
private String token;
|
|
/**
|
*
|
*/
|
private Date expireTime;
|
|
private static final long serialVersionUID = 1L;
|
|
/**
|
* 获取primary key
|
*
|
* @return id - primary key
|
*/
|
public Integer getId() {
|
return id;
|
}
|
|
/**
|
* 设置primary key
|
*
|
* @param id primary key
|
*/
|
public void setId(Integer id) {
|
this.id = id;
|
}
|
|
/**
|
* 获取user id
|
*
|
* @return user - user id
|
*/
|
public Integer getUserId() {
|
return userId;
|
}
|
|
/**
|
* 设置user id
|
*
|
* @param user user id
|
*/
|
public void setUserId(Integer userId) {
|
this.userId = userId;
|
}
|
|
/**
|
* 获取token
|
*
|
* @return token - token
|
*/
|
public String getToken() {
|
return token;
|
}
|
|
/**
|
* 设置token
|
*
|
* @param token token
|
*/
|
public void setToken(String token) {
|
this.token = token;
|
}
|
|
public Date getExpireTime() {
|
return expireTime;
|
}
|
|
public void setExpireTime(Date expireTime) {
|
this.expireTime = expireTime;
|
}
|
|
@Override
|
public String toString() {
|
StringBuilder sb = new StringBuilder();
|
sb.append(getClass().getSimpleName());
|
sb.append(" [");
|
sb.append("Hash = ").append(hashCode());
|
sb.append(", id=").append(id);
|
sb.append(", userId=").append(userId);
|
sb.append(", token=").append(token);
|
sb.append(", expireTime=").append(expireTime);
|
sb.append("]");
|
return sb.toString();
|
}
|
|
@Override
|
public boolean equals(Object that) {
|
if (this == that) {
|
return true;
|
}
|
if (that == null) {
|
return false;
|
}
|
if (getClass() != that.getClass()) {
|
return false;
|
}
|
AccountToken other = (AccountToken) that;
|
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
|
&& (this.getToken() == null ? other.getToken() == null : this.getToken().equals(other.getToken()))
|
&& (this.getExpireTime() == null ? other.getExpireTime() == null : this.getExpireTime().equals(other.getExpireTime()));
|
}
|
|
@Override
|
public int hashCode() {
|
final int prime = 31;
|
int result = 1;
|
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
|
result = prime * result + ((getToken() == null) ? 0 : getToken().hashCode());
|
result = prime * result + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode());
|
return result;
|
}
|
}
|