package cn.reghao.bnt.web.admin.model.vo;

import cn.reghao.jutil.jdk.web.result.NotAvailable;
import cn.reghao.jutil.jdk.converter.DateTimeConverter;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * @author reghao
 * @date 2025-10-02 16:39:07
 */
@NoArgsConstructor
@Setter
@Getter
public class UserSession {
    private int userId;
    private String sessionId;
    private String createAt;
    private String lastRequestAt;
    private String userAgent;
    private String loginIp;

    public UserSession(int userId, String sessionId, LocalDateTime createAt, LocalDateTime lastRequestAt) {
        this.userId = userId;
        this.sessionId = sessionId;
        this.createAt = DateTimeConverter.format(createAt);
        this.lastRequestAt = DateTimeConverter.format(lastRequestAt);
        this.userAgent = NotAvailable.na.getDesc();
        this.loginIp = NotAvailable.na.getDesc();
    }
}
