package com.muyu.demos.model;

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

/**
 * @author DongZl
 * @description: 位置模型
 * @Date 2023-11-20 上午 09:36
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
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();
    }
}
