|
@@ -1,7 +1,11 @@
|
|
|
package com.caimei.www.controller.unlimited;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.caimei.www.controller.BaseController;
|
|
|
import com.caimei.www.pojo.baike.BaikeProduct;
|
|
|
+import com.caimei.www.pojo.baike.BaikeType;
|
|
|
+import com.caimei.www.pojo.page.ImageLink;
|
|
|
+import com.caimei.www.service.page.BaseService;
|
|
|
import com.caimei.www.service.page.ProductService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -10,6 +14,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 采美文库
|
|
@@ -37,11 +42,32 @@ public class EncyclopediaController extends BaseController {
|
|
|
this.productService = productService;
|
|
|
}
|
|
|
|
|
|
+ private BaseService baseService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Autowired
|
|
|
+ public void setBaseService(BaseService baseService) {
|
|
|
+ this.baseService = baseService;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 产品列表
|
|
|
*/
|
|
|
@GetMapping("/encyclopedia/product.html")
|
|
|
- public String getProductList() {
|
|
|
+ public String getProductList(final Model model) {
|
|
|
+ Integer commodityType = 1;
|
|
|
+ // 搜索热门关键字
|
|
|
+ List<String> searchHotWord = baseService.getBaikeSearchHotWord();
|
|
|
+ model.addAttribute("searchHotWord", searchHotWord);
|
|
|
+ // banner图
|
|
|
+ ImageLink banner = baseService.getBaikeBannerImage(commodityType);
|
|
|
+ model.addAttribute("banner", banner);
|
|
|
+ // 分类列表
|
|
|
+ List<BaikeType> typeList = baseService.getBaikeTypeList(commodityType);
|
|
|
+ model.addAttribute("typeList", typeList);
|
|
|
+ // 产品仪器分类数据
|
|
|
+ JSONArray typeData = productService.getBaikeTypeJson(commodityType);
|
|
|
+ model.addAttribute("typeData", typeData);
|
|
|
return PRODUCT_LIST;
|
|
|
}
|
|
|
|
|
@@ -62,7 +88,20 @@ public class EncyclopediaController extends BaseController {
|
|
|
* 仪器列表
|
|
|
*/
|
|
|
@GetMapping("/encyclopedia/instrument.html")
|
|
|
- public String getInstrumentList() {
|
|
|
+ public String getInstrumentList(final Model model) {
|
|
|
+ Integer commodityType = 2;
|
|
|
+ // 搜索热门关键字
|
|
|
+ List<String> searchHotWord = baseService.getBaikeSearchHotWord();
|
|
|
+ model.addAttribute("searchHotWord", searchHotWord);
|
|
|
+ // banner图
|
|
|
+ ImageLink banner = baseService.getBaikeBannerImage(commodityType);
|
|
|
+ model.addAttribute("banner", banner);
|
|
|
+ // 分类列表
|
|
|
+ List<BaikeType> typeList = baseService.getBaikeTypeList(commodityType);
|
|
|
+ model.addAttribute("typeList", typeList);
|
|
|
+ // 产品仪器分类数据
|
|
|
+ JSONArray typeData = productService.getBaikeTypeJson(commodityType);
|
|
|
+ model.addAttribute("typeData", typeData);
|
|
|
return INSTRUMENT_LIST;
|
|
|
}
|
|
|
|