package com.xiaopeng.api.vo.automaticPilot;
|
|
|
import lombok.Data;
|
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;
|
|
import java.io.Serializable;
|
|
/**
|
* 车辆实时位置信息
|
*/
|
@Data
|
@Document(collection = "app_user_position")
|
@CompoundIndexes({
|
@CompoundIndex(name = "appUserId", def = "{'appUserId': 1}"),
|
@CompoundIndex(name = "location_index", def = "{'point': '2dsphere'}")
|
}
|
)
|
public class AppUserPosition implements Serializable {
|
/**
|
* 用户id
|
*/
|
private Long appUserId;
|
/**
|
* 车辆实时位置信息
|
*/
|
@GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
|
private GeoJsonPoint point;
|
/**
|
* 添加时间
|
*/
|
private Long addTime;
|
}
|