package com.muyu.web.domain.model;

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

/**
 * @description: 位置模型
 */
@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();
    }
}
