puzhibing
2023-05-22 c588d0fb5d7b61611b13911e4f0b65e760a7e862
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.agentdriving.user.modular.system.util.mongodb.model;
 
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
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.mapping.Document;
 
import java.io.Serializable;
 
 
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "driver_location")
@CompoundIndex(name = "location_index", def = "{'location': '2dsphere'}")
public class Location implements Serializable {
 
    private static final long serialVersionUID = 4508868382007529970L;
 
    @Id
    private String id;
    /**
     * 司机id
     */
    private Integer driverId;
    /**
     * x:经度 y:纬度
     */
    private GeoJsonPoint location;
    /**
     * 位置名称
     **/
    private String name;
    /**
     * 创建时间
     */
    private Long created;
    /**
     * 更新时间
     */
    private Long updated;
    /**
     * 上次更新时间
     */
    private Long lastUpdated;
 
}