首页新增一套模板

This commit is contained in:
xxy
2019-12-29 08:27:30 +08:00
parent 4e5bdbd953
commit 555aaf68f3
5 changed files with 358 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package xyz.zinglizingli.books.web;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
@ -27,6 +28,9 @@ import java.util.Map;
@Slf4j
public class IndexController {
@Value("${index.template}")
private String indexTemplate;
private final BookService bookService;
@ -66,6 +70,6 @@ public class IndexController {
modelMap.put("hotBooks", hotBooks);
modelMap.put("newBooks", newBooks);
return "books/index";
return "books/index_"+indexTemplate;
}
}