소스 검색

关键词

huangzhiguo 2 년 전
부모
커밋
8bafc0c48e

+ 4 - 0
src/main/java/com/caimei/www/pojo/baike/BaikeProductVo.java

@@ -159,4 +159,8 @@ public class BaikeProductVo implements Serializable {
     private String shopLogo;
 
     private Integer authUserId;
+    /**
+     * 关联标签库字符串
+     */
+    private String relatedLabels;
 }

+ 4 - 0
src/main/java/com/caimei/www/pojo/page/Article.java

@@ -80,6 +80,10 @@ public class Article implements Serializable {
      * 点赞数量
      */
     private Integer likes;
+    /**
+     * 关联标签库字符串
+     */
+    private String relatedLabels;
 
     private static final long serialVersionUID = 1L;
 

+ 1 - 0
src/main/java/com/caimei/www/service/page/impl/ArticleServiceImpl.java

@@ -187,6 +187,7 @@ public class ArticleServiceImpl implements ArticleService {
         List<Article> relateds = articleDao.getArticleRelatedLimit(id, strings);
         relateds.forEach(item -> {
             item.setImage(ImageUtil.getImageURL("", item.getImage(), 0, domain));
+            item.setRelatedLabels(item.getRelatedLabels().replaceAll("##",","));
         });
         return relateds;
     }

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

@@ -471,6 +471,7 @@ public class ProductServiceImpl implements ProductService {
             };
         }
         entryInfo.setReferenceList(referenceList);
+        entryInfo.setRelatedLabels(entryInfo.getRelatedLabels().replaceAll("##",","));
         return entryInfo;
     }
 }

+ 2 - 1
src/main/resources/mapper/ArticleMapper.xml

@@ -151,7 +151,8 @@
 		a.infoContent as content,
 		(IFNULL(c.pv, 0) + IFNULL(a.basePv, 0) + IFNULL((c.num + a.basePraise), 0)) as pv,
 		a.label as label,
-		a.typeId as typeId
+		a.typeId as typeId,
+		a.relatedLabels
 		from info as a
 		left join info_praise c on a.id = c.infoId
 		<where>

+ 2 - 1
src/main/resources/mapper/BaikeMapper.xml

@@ -158,7 +158,8 @@
 			p.publishSource,
 			p.shopId,
 			p.basePv,
-			p.seoKeyword
+			p.seoKeyword,
+			p.relatedLabels
 		from cm_baike_product p
 				 left join cm_baike_type t on p.typeId=t.id
 				 LEFT JOIN shop s ON p.shopId = s.shopID