fix(server-go): 恢复 /health 路由(原 health.go 被覆盖),健康画像独立注册

This commit is contained in:
weijuesen
2026-08-13 14:31:00 +08:00
parent 492d1ef71c
commit 3e9916abd2
2 changed files with 11 additions and 3 deletions
+9 -2
View File
@@ -12,8 +12,15 @@ import (
"gorm.io/gorm"
)
// RegisterHealthRoutes 注册蚕房健康画像路由
func RegisterHealthRoutes(rg *gin.RouterGroup, db *gorm.DB) {
// RegisterHealthRoutes 注册健康检查路由
func RegisterHealthRoutes(rg *gin.RouterGroup) {
rg.GET("/health", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
})
}
// RegisterHealthProfileRoutes 注册蚕房健康画像路由
func RegisterHealthProfileRoutes(rg *gin.RouterGroup, db *gorm.DB) {
rg.GET("/health-profiles/:roomId",
middleware.RequirePermission(db, "room:read"),
roomHealthProfile(db))