package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 用户会话对象 user_sessions
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
public class UserSessions extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 会话ID */
    private String sessionId;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 会话开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "会话开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date sessionStart;

    /** 会话结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "会话结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date sessionEnd;

    /** 会话状态 */
    @Excel(name = "会话状态")
    private String status;

    /** 最后活动时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后活动时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastActivity;

    /** 会话令牌 */
    @Excel(name = "会话令牌")
    private String sessionToken;

    public void setSessionId(String sessionId) 
    {
        this.sessionId = sessionId;
    }

    public String getSessionId() 
    {
        return sessionId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setSessionStart(Date sessionStart) 
    {
        this.sessionStart = sessionStart;
    }

    public Date getSessionStart() 
    {
        return sessionStart;
    }
    public void setSessionEnd(Date sessionEnd) 
    {
        this.sessionEnd = sessionEnd;
    }

    public Date getSessionEnd() 
    {
        return sessionEnd;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setLastActivity(Date lastActivity) 
    {
        this.lastActivity = lastActivity;
    }

    public Date getLastActivity() 
    {
        return lastActivity;
    }

    public void setSessionToken(String sessionToken) 
    {
        this.sessionToken = sessionToken;
    }

    public String getSessionToken() 
    {
        return sessionToken;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("sessionId", getSessionId())
            .append("userId", getUserId())
            .append("sessionStart", getSessionStart())
            .append("sessionEnd", getSessionEnd())
            .append("status", getStatus())
            .append("lastActivity", getLastActivity())
            .append("sessionToken", getSessionToken())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}