2026-07-28 10:42:26 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// GasorderTrackPoint 对应 gasorder_track_point,保存不可变配送位置点。
|
|
|
|
|
|
type GasorderTrackPoint struct {
|
|
|
|
|
|
Entity // 公共实体字段
|
2026-07-30 18:04:34 +08:00
|
|
|
|
GasorderTrackID uint64 `gorm:"column:gasorder_track_id;not null;index" json:"gasorder_track_id"` // 轨迹自增主键
|
|
|
|
|
|
RequestNo string `gorm:"column:request_no;type:varchar(128);not null;default:'';uniqueIndex:,where:request_no <> ''" json:"request_no"` // 上报幂等号
|
|
|
|
|
|
Longitude string `gorm:"column:longitude;type:varchar(32);not null" json:"longitude"` // 经度
|
|
|
|
|
|
Latitude string `gorm:"column:latitude;type:varchar(32);not null" json:"latitude"` // 纬度
|
|
|
|
|
|
OccurredAt time.Time `gorm:"column:occurred_at;type:timestamptz;not null;index" json:"occurred_at"` // 定位发生时间
|
|
|
|
|
|
ReceivedAt time.Time `gorm:"column:received_at;type:timestamptz;not null;index" json:"received_at"` // 服务端接收时间
|
|
|
|
|
|
Source string `gorm:"column:source;type:varchar(32);not null;default:'gps'" json:"source"` // 定位来源
|
|
|
|
|
|
Accuracy string `gorm:"column:accuracy;type:varchar(32);not null;default:''" json:"accuracy"` // 定位精度
|
|
|
|
|
|
Speed string `gorm:"column:speed;type:varchar(32);not null;default:''" json:"speed"` // 定位速度
|
|
|
|
|
|
Direction string `gorm:"column:direction;type:varchar(32);not null;default:''" json:"direction"` // 定位方向
|
2026-07-28 10:42:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() { database.AppendMigrate(&GasorderTrackPoint{}) }
|
|
|
|
|
|
func (table *GasorderTrackPoint) TableName() string { return "gasorder_track_point" }
|