feat(platform): expose amap runtime health

This commit is contained in:
lingniu
2026-07-04 15:30:51 +08:00
parent 5bbd110743
commit 1f069178d6
6 changed files with 64 additions and 10 deletions

View File

@@ -52,7 +52,11 @@ func NewServer(cfg config.Config) http.Handler {
}
}
api := platform.NewHandler(platform.NewServiceWithRuntime(store, platform.RuntimeInfo{
RequestTimeoutMs: int(cfg.RequestTimeout / time.Millisecond),
RequestTimeoutMs: int(cfg.RequestTimeout / time.Millisecond),
AMapWebJSConfigured: strings.TrimSpace(cfg.AMapWebJSKey) != "",
AMapSecurityProxyEnabled: strings.TrimSpace(cfg.AMapSecurityCode) != "" && strings.TrimSpace(cfg.AMapServiceHost) != "",
AMapSecurityCodeExposed: exposedAMapSecurityCode(cfg) != "",
AMapSecurityServiceHost: strings.TrimSpace(cfg.AMapServiceHost),
}))
handler := static.Handler(cfg.StaticDir, api)
handler = withAppConfig(handler, cfg)