Fixed Controller model.

pull/195/head
ruibaby 2019-06-08 19:55:59 +08:00
parent 12483118af
commit 8176451e5a
3 changed files with 6 additions and 5 deletions

View File

@ -52,7 +52,8 @@ public class ContentCategoryController {
* @return template path: themes/{theme}/categories.ftl
*/
@GetMapping
public String categories() {
public String categories(Model model) {
model.addAttribute("is_categories", true);
return themeService.render("categories");
}
@ -89,7 +90,7 @@ public class ContentCategoryController {
Page<Post> posts = postCategoryService.pagePostBy(category.getId(), pageable);
final int[] rainbow = PageUtil.rainbow(page, posts.getTotalPages(), 3);
model.addAttribute("is_categories", true);
model.addAttribute("is_category", true);
model.addAttribute("posts", posts);
model.addAttribute("rainbow", rainbow);
model.addAttribute("category", category);

View File

@ -60,7 +60,6 @@ public class ContentSheetController {
*/
@GetMapping(value = "/s/{url}")
public String sheet(@PathVariable(value = "url") String url,
@RequestParam(value = "cp", defaultValue = "1") Integer cp,
Model model) {
Sheet sheet = sheetService.getBy(PostStatus.PUBLISHED, url);

View File

@ -56,7 +56,8 @@ public class ContentTagController {
* @return template path: themes/{theme}/tags.ftl
*/
@GetMapping
public String tags() {
public String tags(Model model) {
model.addAttribute("is_tags", true);
return themeService.render("tags");
}
@ -93,7 +94,7 @@ public class ContentTagController {
Page<PostListVO> posts = postService.convertToListVo(postPage);
final int[] rainbow = PageUtil.rainbow(page, posts.getTotalPages(), 3);
model.addAttribute("is_tags", true);
model.addAttribute("is_tag", true);
model.addAttribute("posts", posts);
model.addAttribute("rainbow", rainbow);
model.addAttribute("tag", tag);