package de.accso.flexinale.web;

import de.accso.flexinale.util.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.applicationTitle);
        model.addAttribute("buildVersion",     config.buildVersion);
        model.addAttribute("buildDate",        config.buildDate);

        return "index";
    }
}
