feat: cache protocol realtime raw

This commit is contained in:
lingniu
2026-07-02 11:19:46 +08:00
parent e7d024405a
commit 3a67f6e05f
8 changed files with 304 additions and 27 deletions

View File

@@ -44,6 +44,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case len(parts) == 3 && parts[1] == "protocols":
snapshot, err := h.repository.GetProtocol(r.Context(), vin, envelope.Protocol(strings.ToUpper(parts[2])))
writeResult(w, snapshot, err)
case len(parts) == 3 && parts[1] == "realtime-raw":
payload, err := h.repository.GetRealtimeRaw(r.Context(), vin, envelope.Protocol(strings.ToUpper(parts[2])))
writeResult(w, payload, err)
default:
writeError(w, http.StatusNotFound, "route not found")
}