Преглед на файлове

1.3.3采美百科与词条详情功能优化

JiangChongBo преди 2 години
родител
ревизия
9b7ceb962d

+ 5 - 2
src/main/java/com/caimei/www/controller/unlimited/EncyclopediaController.java

@@ -53,11 +53,14 @@ public class EncyclopediaController extends BaseController {
         }
         }
         //分类集合
-        List<BaikeTypeVo> TypeList = productService.geTypeList();
+        List<BaikeTypeVo> typeList = productService.geTypeList();
+        //根据id查询分类信息
+        BaikeTypeVo typeData = productService.geTypeListByid(typeId);
         //热搜词
         List<BaikeHotSearch> hotSeracherWords=productService.getHotWords();
         model.addAttribute("authUserList", authUserList);
-        model.addAttribute("TypeList", TypeList);
+        model.addAttribute("TypeList", typeList);
+        model.addAttribute("Typedata", typeData);
         model.addAttribute("hotSeracherWords", hotSeracherWords);
         return ENCYCLOPEDIA_LIST;
     }

+ 1 - 0
src/main/java/com/caimei/www/mapper/BaikeDao.java

@@ -63,6 +63,7 @@ public interface BaikeDao {
 
     List<BaikeTypeVo> geTypeList();
 
+    BaikeTypeVo geTypeListByid(Integer typeId);
 
 
 }

+ 3 - 0
src/main/java/com/caimei/www/service/page/ProductService.java

@@ -111,4 +111,7 @@ public interface ProductService {
     BaikeProductVo getEncyclopediaDetail(Integer id);
 
     List<BaikeTypeVo> geTypeList();
+
+    BaikeTypeVo geTypeListByid(Integer typeId);
+
 }

+ 10 - 0
src/main/java/com/caimei/www/service/page/impl/ProductServiceImpl.java

@@ -366,6 +366,16 @@ public class ProductServiceImpl implements ProductService {
         return TypeList;
     }
 
+    /**
+     * 根据id获取分类信息
+     * @return
+     */
+    @Override
+    public BaikeTypeVo geTypeListByid(Integer typeId){
+        BaikeTypeVo typedata = baikeDao.geTypeListByid(typeId);
+        return typedata;
+    }
+
     /**
      * 获取词条详细信息
      * @param id

+ 5 - 0
src/main/resources/mapper/BaikeMapper.xml

@@ -204,4 +204,9 @@
 		select  id as typeId,name,pcBanner,appBanner,bannerLink from cm_baike_type
 		where status=1
 	</select>
+
+	<select id="geTypeListByid"  resultType="com.caimei.www.pojo.baike.BaikeTypeVo">
+		select  id as typeId,name,pcBanner,appBanner,bannerLink from cm_baike_type
+		where status=1 and id=#{typeId}
+	</select>
 </mapper>