优化结构

This commit is contained in:
Yvan
2026-08-28 14:54:06 +08:00
parent 56f9440a6b
commit ae5345de14
15 changed files with 188 additions and 93 deletions
+3 -1
View File
@@ -61,7 +61,9 @@ func NewGinEngineWithRuntime(runtime *config.Store, access *systemservice.Access
if ws != nil && ws.Enabled() {
engine.GET(ws.Path(), handleWebSocket)
}
registerSwagger(engine, prefix, version, logger)
if snapshot == nil || snapshot.Admin == nil || snapshot.Admin.App == nil || strings.ToLower(strings.TrimSpace(snapshot.Admin.App.Env)) != "production" {
registerSwagger(engine, prefix, version, logger)
}
staticfiles.Register(engine, runtime)
if logger != nil {
for _, route := range engine.Routes() {