优化工作-1
This commit is contained in:
@@ -27,7 +27,11 @@ import (
|
||||
"hfb_sys/backend/internal/modules/user"
|
||||
"hfb_sys/backend/internal/modules/wallet"
|
||||
|
||||
_ "hfb_sys/backend/docs" // Swagger 文档
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -44,6 +48,11 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
|
||||
health := handler.NewHealthHandler()
|
||||
engine.GET("/health", health.Check)
|
||||
|
||||
// Swagger 文档路由(仅在非生产环境)
|
||||
if cfg.AppEnv != "production" {
|
||||
engine.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||
}
|
||||
|
||||
jwtManager := auth.NewJWTManager(cfg.JWTSecret)
|
||||
var userRepo *auth.UserRepository
|
||||
if deps.DB != nil {
|
||||
|
||||
Reference in New Issue
Block a user