package com.alterdekim.game.entity;

import com.alterdekim.flash.decompiler.mapper.FlashValue;
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
import com.alterdekim.game.repository.UserRepository;
import jakarta.persistence.*;
import lombok.*;
import org.springframework.beans.factory.annotation.Autowired;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="online_status")
public class OnlineStatus {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @OneToOne
    @JoinColumn(referencedColumnName = "id")
    private User user;

    @Column(nullable = false)
    private Long lastPingUnix;

    public OnlineStatus(User user, Long lastPingUnix) {
        this.user = user;
        this.lastPingUnix = lastPingUnix;
    }
}
