package de.accso.flexinale.api_in.web;

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

@Controller
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";
    }
}
