package ru.mcs.tracker.entity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
@Entity
@Table(name = "locations")
public class LocationEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String deviceGuid;
@Column(nullable = false)
private Double latitude;
@Column(nullable = false)
private Double longitude;
@Column(nullable = false)
private LocalDateTime timestamp;
// Конструкторы, геттеры и сеттеры
public LocationEntity() {}
public LocationEntity(String deviceGuid, Double latitude, Double longitude, LocalDateTime timestamp) {
this.deviceGuid = deviceGuid;
this.latitude = latitude;
this.longitude = longitude;
this.timestamp = timestamp;
}
}