功能:扩展开放平台氢耗溯源与合作站数据
This commit is contained in:
@@ -6,8 +6,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
StatusNormal = "NORMAL"
|
||||
StatusNoData = "NO_DATA"
|
||||
StatusNormal = "NORMAL"
|
||||
StatusNoData = "NO_DATA"
|
||||
StatusDataAnomaly = "DATA_ANOMALY"
|
||||
)
|
||||
|
||||
type QueryRequest struct {
|
||||
@@ -60,6 +61,7 @@ type MileageResult struct {
|
||||
DataTime *string `json:"dataTime"`
|
||||
UpdatedAt *string `json:"updatedAt"`
|
||||
SourceProtocol *string `json:"sourceProtocol"`
|
||||
DataQuality *string `json:"dataQuality,omitempty"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
@@ -72,6 +74,7 @@ type MileageRangeResult struct {
|
||||
DataTime *string `json:"dataTime"`
|
||||
UpdatedAt *string `json:"updatedAt"`
|
||||
SourceProtocol *string `json:"sourceProtocol"`
|
||||
DataQuality *string `json:"dataQuality,omitempty"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
@@ -101,6 +104,44 @@ type TotalMileagePoint struct {
|
||||
TotalMileageKm float64
|
||||
}
|
||||
|
||||
// StationaryVehicleQueryRequest verifies whether an authorized vehicle stayed
|
||||
// at a refuelling-site coordinate during a supplied time window. Coordinates
|
||||
// may be supplied in WGS84 or GCJ02 (Amap) longitude/latitude.
|
||||
type StationaryVehicleQueryRequest struct {
|
||||
StartTime string `json:"startTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
CoordinateSystem string `json:"coordinateSystem,omitempty"`
|
||||
RadiusMeters *float64 `json:"radiusMeters,omitempty"`
|
||||
PlateNumbers []string `json:"plateNumbers,omitempty"`
|
||||
}
|
||||
|
||||
type StationaryVehicleResult struct {
|
||||
VIN string `json:"vin"`
|
||||
PlateNumber string `json:"plateNumber"`
|
||||
StayStartTime string `json:"stayStartTime"`
|
||||
StayEndTime string `json:"stayEndTime"`
|
||||
StayDurationSeconds int64 `json:"stayDurationSeconds"`
|
||||
StayDurationMinutes float64 `json:"stayDurationMinutes"`
|
||||
MatchScore float64 `json:"matchScore"`
|
||||
AverageDistanceM float64 `json:"averageDistanceMeters"`
|
||||
MaxDistanceM float64 `json:"maxDistanceMeters"`
|
||||
AverageSpeedKmh float64 `json:"averageSpeedKmh"`
|
||||
MaxSpeedKmh float64 `json:"maxSpeedKmh"`
|
||||
MatchedSamples int `json:"matchedSamples"`
|
||||
SourceProtocols []string `json:"sourceProtocols"`
|
||||
}
|
||||
|
||||
type StationaryLocationPoint struct {
|
||||
VIN string
|
||||
Protocol string
|
||||
ObservedAt time.Time
|
||||
Longitude float64
|
||||
Latitude float64
|
||||
SpeedKmh float64
|
||||
}
|
||||
|
||||
type RealtimeVehicleRequest struct {
|
||||
PlateNumbers []string `json:"plateNumbers,omitempty"`
|
||||
}
|
||||
@@ -111,22 +152,28 @@ type RealtimeVehiclePoint struct {
|
||||
Longitude float64
|
||||
Latitude float64
|
||||
SpeedKmh float64
|
||||
SOCPercent *float64
|
||||
TotalMileageKm float64
|
||||
ObservedAt time.Time
|
||||
Online bool
|
||||
ActiveToday bool
|
||||
}
|
||||
|
||||
type RealtimeVehicleResult struct {
|
||||
VIN string `json:"vin"`
|
||||
PlateNumber string `json:"plateNumber"`
|
||||
VIN string `json:"vin"`
|
||||
PlateNumber string `json:"plateNumber"`
|
||||
// Protocol is the single, canonical source protocol for this realtime record.
|
||||
// It is normalized to GB32960, MQTT, or JT808.
|
||||
Protocol string `json:"protocol,omitempty"`
|
||||
Longitude *float64 `json:"longitude"`
|
||||
Latitude *float64 `json:"latitude"`
|
||||
SpeedKmh *float64 `json:"speedKmh"`
|
||||
SOCPercent *float64 `json:"socPercent,omitempty"`
|
||||
TotalMileageKm *float64 `json:"totalMileageKm"`
|
||||
RecordTime string `json:"recordTime,omitempty"`
|
||||
TimeDifferenceSeconds *int64 `json:"timeDifferenceSeconds,omitempty"`
|
||||
Online bool `json:"online"`
|
||||
ActiveToday bool `json:"activeToday"`
|
||||
MotionStatus string `json:"motionStatus"`
|
||||
LocationAvailable bool `json:"locationAvailable"`
|
||||
Status string `json:"status"`
|
||||
@@ -139,16 +186,21 @@ type HydrogenStationRequest struct {
|
||||
}
|
||||
|
||||
type HydrogenStation struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ShortName string `json:"shortName,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Province string `json:"province,omitempty"`
|
||||
City string `json:"city,omitempty"`
|
||||
District string `json:"district,omitempty"`
|
||||
Cooperative bool `json:"cooperative"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ShortName string `json:"shortName,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Province string `json:"province,omitempty"`
|
||||
City string `json:"city,omitempty"`
|
||||
District string `json:"district,omitempty"`
|
||||
Cooperative bool `json:"cooperative"`
|
||||
ContactPerson string `json:"contactPerson,omitempty"`
|
||||
ContactPhone string `json:"contactPhone,omitempty"`
|
||||
UnitPrice float64 `json:"unitPrice,omitempty"`
|
||||
MonthlyHydrogenKg float64 `json:"monthlyHydrogenKg"`
|
||||
TotalHydrogenKg float64 `json:"totalHydrogenKg"`
|
||||
}
|
||||
|
||||
type ExternalResponse struct {
|
||||
@@ -258,15 +310,83 @@ type MileageSnapshot struct {
|
||||
}
|
||||
|
||||
type HydrogenObservation struct {
|
||||
VIN string
|
||||
Source string
|
||||
ObservedAt time.Time
|
||||
MassKg float64
|
||||
TankCapacityLiter float64
|
||||
PressureMPa float64
|
||||
TemperatureC float64
|
||||
NoiseKg float64
|
||||
RefuelThresholdKg float64
|
||||
VIN string
|
||||
Source string
|
||||
EventID string
|
||||
ObservedAt time.Time
|
||||
MassKg float64
|
||||
TankCapacityLiter float64
|
||||
PressureMPa float64
|
||||
TemperatureC float64
|
||||
NoiseKg float64
|
||||
RefuelThresholdKg float64
|
||||
FuelCellActive bool
|
||||
FuelCellStateKnown bool
|
||||
FuelCellVoltageV float64
|
||||
FuelCellCurrentA float64
|
||||
FuelCellPowerKnown bool
|
||||
SOCPercent float64
|
||||
SOCKnown bool
|
||||
MileageKm float64
|
||||
MileageKnown bool
|
||||
VehicleState int
|
||||
VehicleStateKnown bool
|
||||
ChargeState int
|
||||
ChargeStateKnown bool
|
||||
RunningMode int
|
||||
RunningModeKnown bool
|
||||
BoundaryEligible bool
|
||||
BoundaryReason string
|
||||
RefuelBoundary bool
|
||||
RefuelAmountKg float64
|
||||
PressureInvalid bool
|
||||
}
|
||||
|
||||
type HydrogenCalculationParameters struct {
|
||||
BatteryCapacityKWh float64 `json:"batteryCapacityKWh"`
|
||||
HydrogenEnergyKWhKg float64 `json:"hydrogenEnergyKWhPerKg"`
|
||||
PowerOnDelaySeconds int `json:"powerOnDelaySeconds"`
|
||||
PowerOffLeadSeconds int `json:"powerOffLeadSeconds"`
|
||||
RefuelRiseMPa float64 `json:"refuelRiseMpa"`
|
||||
RefuelSustainSeconds int `json:"refuelSustainSeconds"`
|
||||
PureElectricDropMPA float64 `json:"pureElectricDropMpa"`
|
||||
PureElectricWindowSeconds int `json:"pureElectricWindowSeconds"`
|
||||
InitialChargeCycleKnown bool `json:"initialChargeCycleKnown,omitempty"`
|
||||
InitialMixedLocked bool `json:"initialMixedLocked,omitempty"`
|
||||
AlgorithmVersion string `json:"algorithmVersion"`
|
||||
}
|
||||
|
||||
type HydrogenIntervalEvidence struct {
|
||||
Index int `json:"index"`
|
||||
Type string `json:"type"`
|
||||
StartTime string `json:"startTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
StartEventID string `json:"startEventId"`
|
||||
EndEventID string `json:"endEventId"`
|
||||
Source string `json:"source"`
|
||||
StartPressureMPa float64 `json:"startPressureMpa"`
|
||||
EndPressureMPa float64 `json:"endPressureMpa"`
|
||||
StartTemperatureC float64 `json:"startTemperatureC"`
|
||||
EndTemperatureC float64 `json:"endTemperatureC"`
|
||||
StartMassKg float64 `json:"startMassKg"`
|
||||
EndMassKg float64 `json:"endMassKg"`
|
||||
RawHydrogenConsumptionKg float64 `json:"rawHydrogenConsumptionKg"`
|
||||
StartSOCPercent *float64 `json:"startSocPercent,omitempty"`
|
||||
EndSOCPercent *float64 `json:"endSocPercent,omitempty"`
|
||||
BatterySOCDeltaPct *float64 `json:"batterySocDeltaPct,omitempty"`
|
||||
BatteryEnergyChangeKWh *float64 `json:"batteryEnergyChangeKWh,omitempty"`
|
||||
ElectricEquivalentKg *float64 `json:"electricEquivalentHydrogenKg,omitempty"`
|
||||
CorrectedConsumptionKg *float64 `json:"correctedHydrogenConsumptionKg,omitempty"`
|
||||
BatteryDischargeKWh *float64 `json:"batteryDischargeKWh,omitempty"`
|
||||
BatteryEquivalentKg *float64 `json:"batteryEquivalentKg,omitempty"`
|
||||
SOCBalancedConsumptionKg *float64 `json:"socBalancedConsumptionKg,omitempty"`
|
||||
StartMileageKm *float64 `json:"startMileageKm,omitempty"`
|
||||
EndMileageKm *float64 `json:"endMileageKm,omitempty"`
|
||||
MileageKm *float64 `json:"mileageKm,omitempty"`
|
||||
ConsumptionKgPer100Km *float64 `json:"consumptionKgPer100Km,omitempty"`
|
||||
SampleCount int `json:"sampleCount"`
|
||||
QualityStatus string `json:"qualityStatus"`
|
||||
QualityReason string `json:"qualityReason"`
|
||||
}
|
||||
|
||||
type HydrogenRateObservation struct {
|
||||
@@ -288,16 +408,42 @@ type HydrogenRateDailyStat struct {
|
||||
}
|
||||
|
||||
type HydrogenDailyStat struct {
|
||||
VIN string
|
||||
Source string
|
||||
Date string
|
||||
ConsumptionKg float64
|
||||
FirstMassKg float64
|
||||
LastMassKg float64
|
||||
SampleCount int
|
||||
RefuelCount int
|
||||
QualityStatus string
|
||||
QualityReason string
|
||||
VIN string
|
||||
Source string
|
||||
Date string
|
||||
ConsumptionKg float64
|
||||
FirstMassKg float64
|
||||
LastMassKg float64
|
||||
CycleMinimumMassKg float64
|
||||
SampleCount int
|
||||
RefuelCount int
|
||||
RefuelAmountKg float64
|
||||
AbnormalDropCount int
|
||||
SuspectedLeakCount int
|
||||
SuspectedLeakMaxPressureDropMPa float64
|
||||
EligibleIntervalCount int
|
||||
QualifiedSegmentCount int
|
||||
ChargeCount int
|
||||
ChargeEnergyKWh float64
|
||||
InvalidSegmentCount int
|
||||
BatterySOCDeltaPct *float64
|
||||
BatteryEnergyChangeKWh *float64
|
||||
ElectricEquivalentKg *float64
|
||||
CorrectedConsumptionKg *float64
|
||||
BatteryDischargeKWh *float64
|
||||
BatteryEquivalentKg *float64
|
||||
SOCBalancedConsumptionKg *float64
|
||||
MixedMileageKm float64
|
||||
PureElectricMileageKm float64
|
||||
ConsumptionKgPer100Km *float64
|
||||
SOCBalancedKgPer100Km *float64
|
||||
CalculationParameters HydrogenCalculationParameters
|
||||
Intervals []HydrogenIntervalEvidence
|
||||
HydrogenIntervals []HydrogenIntervalEvidence
|
||||
FirstObservation HydrogenObservation
|
||||
LastObservation HydrogenObservation
|
||||
QualityStatus string
|
||||
QualityReason string
|
||||
}
|
||||
|
||||
type PortalUser struct {
|
||||
|
||||
Reference in New Issue
Block a user