package com.erp.user.entity.auth;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 登录设备实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("login_devices")
public class LoginDevice implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private Long userId;
    
    private Long tenantId;
    
    private String deviceName;
    
    private String deviceType;
    
    @TableField("device_id")
    private String deviceFingerprint;
    
    @TableField("ip_address")
    private String loginIp;
    
    @TableField(exist = false)
    private String loginLocation;
    
    @TableField(exist = false)
    private String userAgent;
    
    @TableField("last_login_at")
    private LocalDateTime lastActiveAt;
    
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(exist = false)
    private Integer status;
    
    @TableLogic
    private LocalDateTime deletedAt;
}
