|
@@ -3,13 +3,20 @@ package com.backendsys.modules.cms.template;
|
|
import cn.hutool.core.convert.Convert;
|
|
import cn.hutool.core.convert.Convert;
|
|
import com.backendsys.modules.common.aspect.Pages;
|
|
import com.backendsys.modules.common.aspect.Pages;
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.context.MessageSource;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
|
|
|
+import java.util.Locale;
|
|
|
|
+
|
|
@Controller
|
|
@Controller
|
|
public class IndexViewController {
|
|
public class IndexViewController {
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private MessageSource messageSource;
|
|
|
|
+
|
|
@Pages
|
|
@Pages
|
|
@GetMapping({"/"})
|
|
@GetMapping({"/"})
|
|
public String index(Model model, HttpServletRequest request) {
|
|
public String index(Model model, HttpServletRequest request) {
|
|
@@ -34,6 +41,9 @@ public class IndexViewController {
|
|
// model.addAttribute("articleList2", list2);
|
|
// model.addAttribute("articleList2", list2);
|
|
|
|
|
|
// -- Layout ---------------------------------------------
|
|
// -- Layout ---------------------------------------------
|
|
|
|
+ String titleTranslate = messageSource.getMessage("index.title", null, new Locale(lang));
|
|
|
|
+ model.addAttribute("title", titleTranslate);
|
|
|
|
+
|
|
model.addAttribute("layout", "index");
|
|
model.addAttribute("layout", "index");
|
|
return "layout/layout";
|
|
return "layout/layout";
|
|
}
|
|
}
|