package de.accso.flexinale.besucherportal.api_in.web;

import de.accso.flexinale.common.application.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
@Profile({ "!testdata-backoffice & !testdata-ticketing" })
public class IndexWebController {
    @Autowired
    private Config config;

    @GetMapping(value="/")
    @SuppressWarnings("SameReturnValue")
    public String index(final Model model) {
        model.addAttribute("applicationTitle", config.getApplicationTitle());
        model.addAttribute("buildVersion",     config.getBuildVersion());
        model.addAttribute("buildDate",        config.getBuildDate());

        return "index";
    }
}
