|
@@ -2,6 +2,7 @@ package com.caimei.www.controller.unlimited;
|
|
|
|
|
|
import com.caimei.www.controller.BaseController;
|
|
|
import com.caimei.www.pojo.baike.BaikeProductVo;
|
|
|
+import com.caimei.www.pojo.baike.BaikeTypeVo;
|
|
|
import com.caimei.www.service.page.ProductService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -36,11 +38,17 @@ public class EncyclopediaController extends BaseController {
|
|
|
/*
|
|
|
* 百科首页
|
|
|
* */
|
|
|
- @GetMapping("/list.html")
|
|
|
- public String getEncyclopediaList(final Model model) {
|
|
|
- String entryName=null;
|
|
|
- List<BaikeProductVo> authUserList = productService.getAuthUserList(entryName);
|
|
|
+ @GetMapping("/list-{typeId}.html")
|
|
|
+ public String getEncyclopediaList(final Model model,@PathVariable("typeId") Integer typeId) {
|
|
|
+ //词条信息
|
|
|
+ List<BaikeProductVo> authUserList = productService.getAuthUserList(typeId);
|
|
|
+ //分类集合
|
|
|
+ List<BaikeTypeVo> TypeList = productService.geTypeList();
|
|
|
+ //热搜词
|
|
|
+ List<String> hotSeracherWords=productService.getHotWords(typeId);
|
|
|
model.addAttribute("authUserList", authUserList);
|
|
|
+ model.addAttribute("TypeList", TypeList);
|
|
|
+ model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
|
return ENCYCLOPEDIA_LIST;
|
|
|
}
|
|
|
|
|
@@ -50,6 +58,9 @@ public class EncyclopediaController extends BaseController {
|
|
|
@GetMapping("/detail-{id}.html")
|
|
|
public String getEncyclopediaDetail(final Model model, @PathVariable("id") Integer id) {
|
|
|
BaikeProductVo baikeproduct = productService.getEncyclopediaDetail(id);
|
|
|
+ //热搜词
|
|
|
+ List<String> hotSeracherWords=productService.getHotWords(null);
|
|
|
+ model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
|
model.addAttribute("baikeproduct", baikeproduct);
|
|
|
return ENCYCLOPEDIA_DETAIL;
|
|
|
}
|
|
@@ -59,6 +70,9 @@ public class EncyclopediaController extends BaseController {
|
|
|
* */
|
|
|
@GetMapping("/search.html")
|
|
|
public String getEncyclopediaSearch(final Model model) {
|
|
|
+ //热搜词
|
|
|
+ List<String> hotSeracherWords=productService.getHotWords(null);
|
|
|
+ model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
|
return ENCYCLOPEDIA_SEARCH;
|
|
|
}
|
|
|
|
|
@@ -67,6 +81,9 @@ public class EncyclopediaController extends BaseController {
|
|
|
* */
|
|
|
@GetMapping("/about.html")
|
|
|
public String getEncyclopediaAbout(final Model model) {
|
|
|
+ //热搜词
|
|
|
+ List<String> hotSeracherWords=productService.getHotWords(null);
|
|
|
+ model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
|
return ENCYCLOPEDIA_ABOUT;
|
|
|
}
|
|
|
}
|