package dashboard

import (
	"github.com/gin-gonic/gin"
	"hyapp-admin-server/internal/repository"
	"hyapp-admin-server/internal/response"
)

type Handler struct {
	service *DashboardService
}

func New(store *repository.Store) *Handler {
	return &Handler{service: NewService(store)}
}

func (h *Handler) DashboardOverview(c *gin.Context) {
	overview, err := h.service.Overview()
	if err != nil {
		response.ServerError(c, "获取总览失败")
		return
	}
	response.OK(c, overview)
}
