package com.gbcm.client.web;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import io.quarkus.qute.Template;
import io.quarkus.qute.TemplateInstance;
import jakarta.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Contrôleur principal pour l'interface web GBCM
 * 
 * @author GBCM Team
 * @version 1.0.0
 * @since 2025-01-01
 */
@Path("/")
public class HomeController {
    
    private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
    
    @Inject
    Template index;
    
    @GET
    @Produces(MediaType.TEXT_HTML)
    public TemplateInstance home() {
        logger.info("Accès à la page d'accueil GBCM");
        return index.data("title", "GBCM - Global Business Consulting & Management")
                   .data("message", "Bienvenue dans l'interface web GBCM");
    }
    
    @GET
    @Path("/health")
    @Produces(MediaType.APPLICATION_JSON)
    public String health() {
        return "{\"status\":\"UP\",\"service\":\"gbcm-client-web\"}";
    }
}
