fix(server-go): 恢复 /health 路由(原 health.go 被覆盖),健康画像独立注册
This commit is contained in:
@@ -118,7 +118,8 @@ func main() {
|
|||||||
handler.RegisterConsultationRoutes(api, db)
|
handler.RegisterConsultationRoutes(api, db)
|
||||||
handler.RegisterDetectionMethodRoutes(api, db)
|
handler.RegisterDetectionMethodRoutes(api, db)
|
||||||
handler.RegisterTraceRoutes(api, db)
|
handler.RegisterTraceRoutes(api, db)
|
||||||
handler.RegisterHealthRoutes(api, db)
|
handler.RegisterHealthRoutes(api)
|
||||||
|
handler.RegisterHealthProfileRoutes(api, db)
|
||||||
|
|
||||||
// 启动高发病天气预警定时任务(未配置时跳过)
|
// 启动高发病天气预警定时任务(未配置时跳过)
|
||||||
go startWeatherAlertLoop(db, weatherSvc, time.Duration(cfg.QWeatherIntervalMin)*time.Minute)
|
go startWeatherAlertLoop(db, weatherSvc, time.Duration(cfg.QWeatherIntervalMin)*time.Minute)
|
||||||
|
|||||||
@@ -12,8 +12,15 @@ import (
|
|||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterHealthRoutes 注册蚕房健康画像路由
|
// RegisterHealthRoutes 注册健康检查路由
|
||||||
func RegisterHealthRoutes(rg *gin.RouterGroup, db *gorm.DB) {
|
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",
|
rg.GET("/health-profiles/:roomId",
|
||||||
middleware.RequirePermission(db, "room:read"),
|
middleware.RequirePermission(db, "room:read"),
|
||||||
roomHealthProfile(db))
|
roomHealthProfile(db))
|
||||||
|
|||||||
Reference in New Issue
Block a user