优化结构
This commit is contained in:
@@ -21,10 +21,10 @@ import (
|
||||
)
|
||||
|
||||
func NewGinEngine(runtime *config.Store, access *service.AccessControlService, handlers *handler.Set, auth *service.AuthService, security *service.SecurityService, audit *service.AuditRecorder, logger *slog.Logger, version string) *gin.Engine {
|
||||
return NewGinEngineWithRuntime(runtime, access, auth, security, audit, logger, version, platformmodule.NewRuntime(router.NewRoutes(handlers)), nil)
|
||||
return NewGinEngineWithRuntime(runtime, access, auth, security, audit, logger, version, router.NewRoutes(handlers), nil)
|
||||
}
|
||||
|
||||
func NewGinEngineWithRuntime(runtime *config.Store, access *service.AccessControlService, auth middleware.TokenAuthenticator, security *service.SecurityService, audit *service.AuditRecorder, logger *slog.Logger, version string, routes *platformmodule.Runtime, ws *websocket.Server) *gin.Engine {
|
||||
func NewGinEngineWithRuntime(runtime *config.Store, access *service.AccessControlService, auth middleware.TokenAuthenticator, security *service.SecurityService, audit *service.AuditRecorder, logger *slog.Logger, version string, routes platformmodule.RouteRegistrar, ws *websocket.Server) *gin.Engine {
|
||||
if runtime == nil {
|
||||
runtime = config.NewStore(nil)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
// This file is the handler package's single vocabulary for HTTP replies: the
|
||||
// envelope helpers come from pkg/httpx and Claims from the auth middleware, so
|
||||
// handlers name one package instead of two.
|
||||
package handler
|
||||
|
||||
import (
|
||||
"kra/internal/biz/system"
|
||||
"kra/internal/server/middleware"
|
||||
httpx "kra/pkg/httpx"
|
||||
"kra/pkg/httpx"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user