refactor: restructure in entirety

This commit is contained in:
Arkaprabha Chakraborty
2025-12-06 15:31:18 +05:30
parent 28733e22d3
commit 17a2bce744
43 changed files with 854 additions and 1342 deletions

View File

@@ -0,0 +1,23 @@
package handler
import (
"billit/internal/database"
"net/http"
"github.com/labstack/echo/v4"
)
// HealthHandlers holds dependencies for health checks
type HealthHandlers struct {
db database.Service
}
// NewHealthHandlers creates health handlers with db access
func NewHealthHandlers(db database.Service) *HealthHandlers {
return &HealthHandlers{db: db}
}
// HealthHandler returns the health status
func (h *HealthHandlers) HealthHandler(c echo.Context) error {
return c.JSON(http.StatusOK, h.db.Health())
}