package com.muyu.vehicleGateway.web.domain.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName PositionModel
 * @Description 位置模型
 * @Author LiHD
 * @Date 2024/9/27 20:59
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PositionModel {

    /**
     * 经度
     */
    private String longitude;

    /**
     * 纬度
     */
    private String latitude;

    public static PositionModel strBuild(String positionStr) {
        String[] split = positionStr.split(",");
        return PositionModel.builder()
                .longitude(split[0])
                .latitude(split[1])
                .build();
    }
}
