package handlers import ( "net/http" "time" "api-service/internal/models" "github.com/gin-gonic/gin" ) // HealthHandler handles health check endpoints type HealthHandler struct{} // NewHealthHandler creates a new HealthHandler func NewHealthHandler() *HealthHandler { return &HealthHandler{} } // GetHealth godoc // @Summary Health check endpoint // @Description Returns the health status of the API service // @Tags health // @Accept json // @Produce json // @Success 200 {object} models.HealthResponse "Health status" // @Failure 500 {object} models.ErrorResponse "Internal server error" // @Router /health [get] func (h *HealthHandler) GetHealth(c *gin.Context) { health := models.HealthResponse{ Status: "healthy", Timestamp: time.Now().Format(time.RFC3339), Details: map[string]string{ "service": "api-service", "version": "1.0.0", }, } c.JSON(http.StatusOK, health) } // HelloWorld godoc // @Summary Hello World endpoint // @Description Returns a hello world message // @Tags root // @Accept json // @Produce json // @Success 200 {object} models.HelloWorldResponse "Hello world message" // @Router / [get] func (h *HealthHandler) HelloWorld(c *gin.Context) { response := models.HelloWorldResponse{ Message: "Hello World", Version: "1.0.0", } c.JSON(http.StatusOK, response) }