fix: restore storage endpoint for smoke test

This commit is contained in:
ShukeBta
2026-06-11 21:11:05 +08:00
parent 52d75171b2
commit 0e28d07122
3 changed files with 50 additions and 2 deletions
+20
View File
@@ -0,0 +1,20 @@
package handler
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/ShukeBta/MediaStationGo/internal/service"
)
func storageBreakdownHandler(svc *service.Container) gin.HandlerFunc {
return func(c *gin.Context) {
breakdown, err := svc.Storage.Compute(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, breakdown)
}
}