package api

import (
	"licserver/internal/service"
	"net/http"

	"github.com/gin-gonic/gin"
)

type MonitorHandler struct {
	monitorService *service.MonitorService
}

func NewMonitorHandler(monitorService *service.MonitorService) *MonitorHandler {
	return &MonitorHandler{monitorService: monitorService}
}

func (h *MonitorHandler) GetSystemStatus(c *gin.Context) {
	status, err := h.monitorService.GetSystemStatus()
	if err != nil {
		c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
		return
	}

	c.JSON(http.StatusOK, status)
}
