第 0 阶段:项目初始化

This commit is contained in:
yml
2026-05-22 15:05:28 +08:00
commit 8e7f1f17f0
55 changed files with 4519 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
package router
import (
"hfb_sys/backend/internal/config"
"hfb_sys/backend/internal/handler"
"hfb_sys/backend/internal/middleware"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
func New(cfg config.Config, logger *zap.Logger) *gin.Engine {
if cfg.AppEnv == "production" {
gin.SetMode(gin.ReleaseMode)
}
engine := gin.New()
engine.Use(gin.Recovery())
engine.Use(middleware.RequestLogger(logger))
health := handler.NewHealthHandler()
engine.GET("/health", health.Check)
api := engine.Group("/api")
{
api.GET("/health", health.Check)
}
return engine
}