feat(platform): expose vehicle service runtime health

This commit is contained in:
lingniu
2026-07-04 01:02:07 +08:00
parent 377cfcdfca
commit 3e76210d7d
6 changed files with 53 additions and 6 deletions

View File

@@ -36,13 +36,18 @@ type RawFrameQuery struct {
}
type Service struct {
store Store
store Store
runtime RuntimeInfo
}
func NewService(store Store) *Service {
return &Service{store: store}
}
func NewServiceWithRuntime(store Store, runtime RuntimeInfo) *Service {
return &Service{store: store, runtime: runtime}
}
func (s *Service) DashboardSummary(ctx context.Context) (DashboardSummary, error) {
return s.store.DashboardSummary(ctx)
}
@@ -282,7 +287,12 @@ func (s *Service) QualityIssues(ctx context.Context, query url.Values) (Page[Qua
}
func (s *Service) OpsHealth(ctx context.Context) (OpsHealth, error) {
return s.store.OpsHealth(ctx)
health, err := s.store.OpsHealth(ctx)
if err != nil {
return OpsHealth{}, err
}
health.Runtime = s.runtime
return health, nil
}
func (s *Service) resolveVehicleQuery(ctx context.Context, query url.Values) (url.Values, error) {