Files
MeBox/internal/handler/storage.go
T
2026-06-11 21:11:05 +08:00

21 lines
432 B
Go

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)
}
}