package com.xiaopeng.api.dto.account; import com.baomidou.mybatisplus.annotation.EnumValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.geo.GeoJsonPoint; import org.springframework.data.mongodb.core.index.CompoundIndex; import org.springframework.data.mongodb.core.index.CompoundIndexes; import org.springframework.data.mongodb.core.index.GeoSpatialIndexType; import org.springframework.data.mongodb.core.index.GeoSpatialIndexed; import org.springframework.data.mongodb.core.mapping.Document; /** * 运维人员查询条件DTO * * @author mitao */ @Data @ApiModel("运维人员状态") @Document(collection = "xp_operations_user_position") @CompoundIndexes({ @CompoundIndex(name = "idx_status", def = "{'status': 1}"), @CompoundIndex(name = "idx_location", def = "{'location': '2dsphere'}") }) public class XpOperationsUserPositionDTO { @ApiModelProperty(value = "运维人员id") @Id private long id; @ApiModelProperty(value = "经度") private double latitude; @ApiModelProperty(value = "纬度") private double longitude; @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE) private GeoJsonPoint location; @ApiModelProperty(value = "状态:0在线,1空闲,2上班中") private Integer status; @ApiModelProperty(value = "距离,这个是mongoDB查询时填充") private double distance; }