216 lines
7.5 KiB
Go
216 lines
7.5 KiB
Go
package platform
|
|
|
|
type Page[T any] struct {
|
|
Items []T `json:"items"`
|
|
Total int `json:"total"`
|
|
Limit int `json:"limit"`
|
|
Offset int `json:"offset"`
|
|
}
|
|
|
|
type DashboardSummary struct {
|
|
OnlineVehicles int `json:"onlineVehicles"`
|
|
ActiveToday int `json:"activeToday"`
|
|
FrameToday int `json:"frameToday"`
|
|
IssueVehicles int `json:"issueVehicles"`
|
|
KafkaLag *int `json:"kafkaLag"`
|
|
Protocols []ProtocolStat `json:"protocols"`
|
|
LinkHealth []LinkHealth `json:"linkHealth"`
|
|
}
|
|
|
|
type ProtocolStat struct {
|
|
Protocol string `json:"protocol"`
|
|
Online int `json:"online"`
|
|
Total int `json:"total"`
|
|
}
|
|
|
|
type LinkHealth struct {
|
|
Name string `json:"name"`
|
|
Status string `json:"status"`
|
|
Detail string `json:"detail,omitempty"`
|
|
}
|
|
|
|
type VehicleRow struct {
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Phone string `json:"phone"`
|
|
OEM string `json:"oem"`
|
|
Protocol string `json:"protocol"`
|
|
Online bool `json:"online"`
|
|
LastSeen string `json:"lastSeen"`
|
|
LocationText string `json:"locationText"`
|
|
BindingScore int `json:"bindingScore"`
|
|
}
|
|
|
|
type VehicleCoverageRow struct {
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Phone string `json:"phone"`
|
|
OEM string `json:"oem"`
|
|
Protocols []string `json:"protocols"`
|
|
SourceCount int `json:"sourceCount"`
|
|
OnlineSourceCount int `json:"onlineSourceCount"`
|
|
Online bool `json:"online"`
|
|
LastSeen string `json:"lastSeen"`
|
|
BindingStatus string `json:"bindingStatus"`
|
|
}
|
|
|
|
type VehicleIdentityResolution struct {
|
|
LookupKey string `json:"lookupKey"`
|
|
Resolved bool `json:"resolved"`
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Phone string `json:"phone"`
|
|
OEM string `json:"oem"`
|
|
Protocols []string `json:"protocols"`
|
|
Online bool `json:"online"`
|
|
LastSeen string `json:"lastSeen"`
|
|
}
|
|
|
|
type VehicleDetail struct {
|
|
VIN string `json:"vin"`
|
|
LookupKey string `json:"lookupKey"`
|
|
LookupResolved bool `json:"lookupResolved"`
|
|
Resolution *VehicleIdentityResolution `json:"resolution,omitempty"`
|
|
Identity *VehicleRow `json:"identity,omitempty"`
|
|
RealtimeSummary *VehicleRealtimeRow `json:"realtimeSummary,omitempty"`
|
|
ServiceStatus *VehicleServiceStatus `json:"serviceStatus,omitempty"`
|
|
Sources []string `json:"sources"`
|
|
SourceStatus []VehicleSourceStatus `json:"sourceStatus"`
|
|
Realtime []RealtimeLocationRow `json:"realtime"`
|
|
History Page[HistoryLocationRow] `json:"history"`
|
|
Raw Page[RawFrameRow] `json:"raw"`
|
|
Mileage Page[DailyMileageRow] `json:"mileage"`
|
|
Quality Page[QualityIssueRow] `json:"quality"`
|
|
}
|
|
|
|
type VehicleServiceStatus struct {
|
|
Status string `json:"status"`
|
|
Severity string `json:"severity"`
|
|
Title string `json:"title"`
|
|
Detail string `json:"detail"`
|
|
SourceCount int `json:"sourceCount"`
|
|
OnlineSourceCount int `json:"onlineSourceCount"`
|
|
}
|
|
|
|
type VehicleSourceStatus struct {
|
|
Protocol string `json:"protocol"`
|
|
Online bool `json:"online"`
|
|
LastSeen string `json:"lastSeen"`
|
|
HasRealtime bool `json:"hasRealtime"`
|
|
HasHistory bool `json:"hasHistory"`
|
|
HasRaw bool `json:"hasRaw"`
|
|
HasMileage bool `json:"hasMileage"`
|
|
}
|
|
|
|
type RealtimeLocationRow struct {
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Protocol string `json:"protocol"`
|
|
Longitude float64 `json:"longitude"`
|
|
Latitude float64 `json:"latitude"`
|
|
SpeedKmh float64 `json:"speedKmh"`
|
|
SOCPercent float64 `json:"socPercent"`
|
|
TotalMileageKm float64 `json:"totalMileageKm"`
|
|
LastSeen string `json:"lastSeen"`
|
|
}
|
|
|
|
type VehicleRealtimeRow struct {
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Phone string `json:"phone"`
|
|
OEM string `json:"oem"`
|
|
Protocols []string `json:"protocols"`
|
|
SourceCount int `json:"sourceCount"`
|
|
OnlineSourceCount int `json:"onlineSourceCount"`
|
|
Online bool `json:"online"`
|
|
PrimaryProtocol string `json:"primaryProtocol"`
|
|
Longitude float64 `json:"longitude"`
|
|
Latitude float64 `json:"latitude"`
|
|
SpeedKmh float64 `json:"speedKmh"`
|
|
SOCPercent float64 `json:"socPercent"`
|
|
TotalMileageKm float64 `json:"totalMileageKm"`
|
|
LastSeen string `json:"lastSeen"`
|
|
}
|
|
|
|
type HistoryLocationRow struct {
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Protocol string `json:"protocol"`
|
|
Longitude float64 `json:"longitude"`
|
|
Latitude float64 `json:"latitude"`
|
|
SpeedKmh float64 `json:"speedKmh"`
|
|
TotalMileageKm float64 `json:"totalMileageKm"`
|
|
DeviceTime string `json:"deviceTime"`
|
|
ServerTime string `json:"serverTime"`
|
|
}
|
|
|
|
type RawFrameRow struct {
|
|
ID string `json:"id"`
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Protocol string `json:"protocol"`
|
|
FrameType string `json:"frameType"`
|
|
DeviceTime string `json:"deviceTime"`
|
|
ServerTime string `json:"serverTime"`
|
|
RawSizeBytes int `json:"rawSizeBytes"`
|
|
ParsedFields map[string]any `json:"parsedFields"`
|
|
}
|
|
|
|
type DailyMileageRow struct {
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Date string `json:"date"`
|
|
StartMileageKm float64 `json:"startMileageKm"`
|
|
EndMileageKm float64 `json:"endMileageKm"`
|
|
DailyMileageKm float64 `json:"dailyMileageKm"`
|
|
Source string `json:"source"`
|
|
AnomalySeverity string `json:"anomalySeverity,omitempty"`
|
|
}
|
|
|
|
type MileageSummary struct {
|
|
VehicleCount int `json:"vehicleCount"`
|
|
RecordCount int `json:"recordCount"`
|
|
SourceCount int `json:"sourceCount"`
|
|
TotalMileageKm float64 `json:"totalMileageKm"`
|
|
AverageMileagePerVIN float64 `json:"averageMileagePerVin"`
|
|
}
|
|
|
|
type QualityIssueRow struct {
|
|
VIN string `json:"vin"`
|
|
Plate string `json:"plate"`
|
|
Phone string `json:"phone"`
|
|
SourceEndpoint string `json:"sourceEndpoint"`
|
|
Protocol string `json:"protocol"`
|
|
IssueType string `json:"issueType"`
|
|
Severity string `json:"severity"`
|
|
LastSeen string `json:"lastSeen"`
|
|
Detail string `json:"detail"`
|
|
}
|
|
|
|
type QualitySummary struct {
|
|
IssueVehicleCount int `json:"issueVehicleCount"`
|
|
IssueRecordCount int `json:"issueRecordCount"`
|
|
ErrorCount int `json:"errorCount"`
|
|
WarningCount int `json:"warningCount"`
|
|
Protocols []QualityBucketStat `json:"protocols"`
|
|
IssueTypes []QualityBucketStat `json:"issueTypes"`
|
|
}
|
|
|
|
type QualityBucketStat struct {
|
|
Name string `json:"name"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type OpsHealth struct {
|
|
LinkHealth []LinkHealth `json:"linkHealth"`
|
|
KafkaLag *int `json:"kafkaLag"`
|
|
RedisOnlineKeys *int `json:"redisOnlineKeys"`
|
|
TDengineWritable bool `json:"tdengineWritable"`
|
|
MySQLWritable bool `json:"mysqlWritable"`
|
|
Runtime RuntimeInfo `json:"runtime"`
|
|
}
|
|
|
|
type RuntimeInfo struct {
|
|
RequestTimeoutMs int `json:"requestTimeoutMs"`
|
|
}
|