package com.estate.expert.admin.domain.session;
|
|
import com.estate.expert.admin.domain.user.User;
|
import lombok.Getter;
|
import lombok.Setter;
|
|
import javax.persistence.*;
|
import java.time.LocalDateTime;
|
|
/**
|
* 用于存储用户登录信息
|
*/
|
@Entity
|
@Getter
|
@Setter
|
@Table(indexes = {
|
@Index(name = "idx_id_token", columnList = "id, token"),
|
})
|
public class UserSession {
|
@Id
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
private Long id;
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
@JoinColumn(name = "user_id")
|
private User user;
|
|
@Column(nullable = false)
|
private String token;
|
|
@Column(nullable = false)
|
private String state;
|
|
private String clientCode;
|
|
private String deviceCode;
|
|
private String ipAddress;
|
|
private String extra;
|
|
@Column(nullable = false)
|
private LocalDateTime createTime;
|
|
@Column(nullable = false)
|
private LocalDateTime lastAccessTime;
|
|
private LocalDateTime expireTime;
|
|
}
|