package cn.reghao.tnb.content.app.geo.model.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author reghao
 * @date 2023-08-31 17:43:27
 */
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
public class MapPoint implements Serializable {
    private static final long serialVersionUID = 1L;

    // 经度
    @NotNull
    private Double lng;
    // 纬度
    @NotNull
    private Double lat;
    private Long timestamp;

    public MapPoint(String lng, String lat) {
        this.lng = Double.parseDouble(lng);
        this.lat = Double.parseDouble(lat);
    }

    public MapPoint(double lng, double lat) {
        this.lng = lng;
        this.lat = lat;
    }
}
