package com.yida.data.server.entity;

import io.swagger.annotations.ApiModelProperty;
import java.util.Optional;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@Builder
@Document
@NoArgsConstructor
@AllArgsConstructor
public class WifimacLocation {

    @Id
    private String id;

    private Double lng;

    private Double lat;

    @ApiModelProperty("mac地址,最长六个")
    private String mac1;

    private String mac2;
    private String mac3;
    private String mac4;
    private String mac5;
    private String mac6;

    public WifimacLocation(Double lng, Double lat, String mac1, String mac2, String mac3, String mac4, String mac5,
        String mac6) {
        this.lng = lng;
        this.lat = lat;
        this.mac1 = Optional.ofNullable(mac1).orElse("");
        this.mac2 = Optional.ofNullable(mac2).orElse("");
        this.mac3 = Optional.ofNullable(mac3).orElse("");
        this.mac4 = Optional.ofNullable(mac4).orElse("");
        this.mac5 = Optional.ofNullable(mac5).orElse("");
        this.mac6 = Optional.ofNullable(mac6).orElse("");
    }
}
