fix(server-go): 健康画像 handler 读取 roomId 参数(此前取空导致 404)

This commit is contained in:
weijuesen
2026-08-13 14:34:10 +08:00
parent 3e9916abd2
commit 008a7b1d4c
+1 -1
View File
@@ -29,7 +29,7 @@ func RegisterHealthProfileRoutes(rg *gin.RouterGroup, db *gorm.DB) {
// roomHealthProfile 单蚕房健康画像:巡检风险/检测结果/事件聚合 → 综合健康分
func roomHealthProfile(db *gorm.DB) gin.HandlerFunc {
return func(c *gin.Context) {
id := c.Param("id")
id := c.Param("roomId")
var room model.Room
if db.Where("id = ?", id).First(&room).Error != nil {
c.JSON(http.StatusNotFound, gin.H{"error": "room not found"})