|
@@ -1,6 +1,7 @@
|
|
|
package com.caimei.www.controller.unlimited;
|
|
|
|
|
|
import com.caimei.www.controller.BaseController;
|
|
|
+import com.caimei.www.pojo.baike.BaikeHotSearch;
|
|
|
import com.caimei.www.pojo.baike.BaikeProductVo;
|
|
|
import com.caimei.www.pojo.baike.BaikeTypeVo;
|
|
|
import com.caimei.www.service.page.ProductService;
|
|
@@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -41,11 +43,19 @@ public class EncyclopediaController extends BaseController {
|
|
|
@GetMapping("/list-{typeId}.html")
|
|
|
public String getEncyclopediaList(final Model model,@PathVariable("typeId") Integer typeId) {
|
|
|
//词条信息
|
|
|
+ SimpleDateFormat sl=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
List<BaikeProductVo> authUserList = productService.getAuthUserList(typeId);
|
|
|
+ if(null!=authUserList&&authUserList.size()>0){
|
|
|
+ for (BaikeProductVo baikeProductVo:authUserList) {
|
|
|
+ if(null!=baikeProductVo.getPublishTime()){
|
|
|
+ baikeProductVo.setPublishTimeStr(sl.format(baikeProductVo.getPublishTime()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//分类集合
|
|
|
List<BaikeTypeVo> TypeList = productService.geTypeList();
|
|
|
//热搜词
|
|
|
- List<String> hotSeracherWords=productService.getHotWords();
|
|
|
+ List<BaikeHotSearch> hotSeracherWords=productService.getHotWords();
|
|
|
model.addAttribute("authUserList", authUserList);
|
|
|
model.addAttribute("TypeList", TypeList);
|
|
|
model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
@@ -57,9 +67,15 @@ public class EncyclopediaController extends BaseController {
|
|
|
* */
|
|
|
@GetMapping("/detail-{id}.html")
|
|
|
public String getEncyclopediaDetail(final Model model, @PathVariable("id") Integer id) {
|
|
|
+ SimpleDateFormat sl=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
BaikeProductVo baikeproduct = productService.getEncyclopediaDetail(id);
|
|
|
+ if(null!=baikeproduct){
|
|
|
+ if(null!=baikeproduct.getPublishTime()){
|
|
|
+ baikeproduct.setPublishTimeStr(sl.format(baikeproduct.getPublishTime()));
|
|
|
+ }
|
|
|
+ }
|
|
|
//热搜词
|
|
|
- List<String> hotSeracherWords=productService.getHotWords();
|
|
|
+ List<BaikeHotSearch> hotSeracherWords=productService.getHotWords();
|
|
|
model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
|
model.addAttribute("baikeproduct", baikeproduct);
|
|
|
return ENCYCLOPEDIA_DETAIL;
|
|
@@ -71,7 +87,7 @@ public class EncyclopediaController extends BaseController {
|
|
|
@GetMapping("/search.html")
|
|
|
public String getEncyclopediaSearch(final Model model) {
|
|
|
//热搜词
|
|
|
- List<String> hotSeracherWords=productService.getHotWords();
|
|
|
+ List<BaikeHotSearch> hotSeracherWords=productService.getHotWords();
|
|
|
model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
|
return ENCYCLOPEDIA_SEARCH;
|
|
|
}
|
|
@@ -82,7 +98,7 @@ public class EncyclopediaController extends BaseController {
|
|
|
@GetMapping("/about.html")
|
|
|
public String getEncyclopediaAbout(final Model model) {
|
|
|
//热搜词
|
|
|
- List<String> hotSeracherWords=productService.getHotWords();
|
|
|
+ List<BaikeHotSearch> hotSeracherWords=productService.getHotWords();
|
|
|
model.addAttribute("hotSeracherWords", hotSeracherWords);
|
|
|
return ENCYCLOPEDIA_ABOUT;
|
|
|
}
|