feat(operations): add auditable source provider maintenance
This commit is contained in:
@@ -323,6 +323,28 @@ Access rows expose both event and receive time, `dataDelaySec`, `freshnessSec`,
|
||||
|
||||
Threshold configuration is stored in `vehicle_access_threshold_config`; every successful update increments `version`, requires the caller's previous version, and writes `vehicle_access_threshold_audit`. Stale updates return `ACCESS_THRESHOLD_VERSION_CONFLICT`. Valid ranges are bounded server-side.
|
||||
|
||||
### V2 Source Diagnostic and Provider Maintenance
|
||||
|
||||
```http
|
||||
GET /api/v2/operations/vehicles/{vin}/sources
|
||||
|
||||
PUT /api/v2/operations/vehicles/{vin}/sources/{sourceRef}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"version": 2,
|
||||
"providerName": "G7s",
|
||||
"providerEvidence": "GPS 运维终端清单 2026-07-16",
|
||||
"enabled": true,
|
||||
"priority": 20,
|
||||
"remark": "保持当前优先级"
|
||||
}
|
||||
```
|
||||
|
||||
The diagnostic response exposes every current location candidate, including the current verified `providerOverride` and gateway-policy `policyRemark`, but never exposes the raw source key. `sourceRef` is a SHA-256 reference resolved only by the server. Operator principals may read this diagnostic; only administrators may write.
|
||||
|
||||
`providerEvidence` is mandatory whenever `providerName` changes, including removal. It is written to the immutable provider audit and is deliberately separate from `remark`, which belongs only to source enable/priority policy. A provider-only update must preserve the existing policy remark. Both change types share the vehicle-level optimistic `version`; stale writes return `SOURCE_POLICY_VERSION_CONFLICT`.
|
||||
|
||||
## Map Reverse Geocoding
|
||||
|
||||
`GET /api/map/reverse-geocode?longitude=<WGS-84>&latitude=<WGS-84>` is an authenticated server-side AMap Web Service adapter. It validates the source coordinate, converts WGS-84 to GCJ-02 exactly once, keeps the server API key out of the browser, and requests only the `base` reverse-geocode response documented by [AMap](https://lbs.amap.com/api/webservice/guide/api/georegeo).
|
||||
|
||||
Reference in New Issue
Block a user