fix(server-go): 健康画像路由与 /rooms/:id 冲突导致启动 panic,改 /health-profiles/:roomId
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
// RegisterHealthRoutes 注册蚕房健康画像路由
|
// RegisterHealthRoutes 注册蚕房健康画像路由
|
||||||
func RegisterHealthRoutes(rg *gin.RouterGroup, db *gorm.DB) {
|
func RegisterHealthRoutes(rg *gin.RouterGroup, db *gorm.DB) {
|
||||||
rg.GET("/rooms/:id/health-profile",
|
rg.GET("/health-profiles/:roomId",
|
||||||
middleware.RequirePermission(db, "room:read"),
|
middleware.RequirePermission(db, "room:read"),
|
||||||
roomHealthProfile(db))
|
roomHealthProfile(db))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export interface HealthProfile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getHealthProfile = (roomId: string) =>
|
export const getHealthProfile = (roomId: string) =>
|
||||||
get<HealthProfile>(`/rooms/${roomId}/health-profile`);
|
get<HealthProfile>(`/health-profiles/${roomId}`);
|
||||||
|
|
||||||
export const getMonthlyStats = (year?: number) =>
|
export const getMonthlyStats = (year?: number) =>
|
||||||
get<{ year: number; stats: { month: string; total: number; diseases: Record<string, number> }[] }>(
|
get<{ year: number; stats: { month: string; total: number; diseases: Record<string, number> }[] }>(
|
||||||
|
|||||||
Reference in New Issue
Block a user