PC也返回cover1,cover2,方便gateway兼容
Showing
1 changed file
with
5 additions
and
0 deletions
@@ -7,6 +7,7 @@ import java.util.Map; | @@ -7,6 +7,7 @@ import java.util.Map; | ||
7 | 7 | ||
8 | import javax.annotation.PostConstruct; | 8 | import javax.annotation.PostConstruct; |
9 | 9 | ||
10 | +import com.yoho.search.service.helper.GoodsCoverHelper; | ||
10 | import org.apache.commons.collections.MapUtils; | 11 | import org.apache.commons.collections.MapUtils; |
11 | import org.apache.commons.lang.StringUtils; | 12 | import org.apache.commons.lang.StringUtils; |
12 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -21,6 +22,8 @@ public class WebProductIndexBaseService { | @@ -21,6 +22,8 @@ public class WebProductIndexBaseService { | ||
21 | 22 | ||
22 | @Autowired | 23 | @Autowired |
23 | private ProductPricePlanIndexBaseService productPricePlanIndexBaseService; | 24 | private ProductPricePlanIndexBaseService productPricePlanIndexBaseService; |
25 | + @Autowired | ||
26 | + private GoodsCoverHelper goodsCoverHelper; | ||
24 | 27 | ||
25 | // 获取从source中不返回的字段定义,用以节省带宽 | 28 | // 获取从source中不返回的字段定义,用以节省带宽 |
26 | private List<String> productIndexIncludeFields = new ArrayList<String>(); | 29 | private List<String> productIndexIncludeFields = new ArrayList<String>(); |
@@ -100,6 +103,8 @@ public class WebProductIndexBaseService { | @@ -100,6 +103,8 @@ public class WebProductIndexBaseService { | ||
100 | productMap.put("vip3_price", MapUtils.getDoubleValue(map, ProductIndexEsField.vip3Price, 0)); | 103 | productMap.put("vip3_price", MapUtils.getDoubleValue(map, ProductIndexEsField.vip3Price, 0)); |
101 | productMap.put("vip_discount_type", MapUtils.getIntValue(map, ProductIndexEsField.vipDiscountType, 1)); | 104 | productMap.put("vip_discount_type", MapUtils.getIntValue(map, ProductIndexEsField.vipDiscountType, 1)); |
102 | 105 | ||
106 | + // 把gateway逻辑抽过来,抽取cover1,cover2 | ||
107 | + goodsCoverHelper.buildGoodsCover(map, productMap); | ||
103 | productMap.put("default_images", MapUtils.getString(map, ProductIndexEsField.defaultImages, "")); | 108 | productMap.put("default_images", MapUtils.getString(map, ProductIndexEsField.defaultImages, "")); |
104 | productMap.put("first_shelve_time", MapUtils.getIntValue(map, ProductIndexEsField.firstShelveTime)); | 109 | productMap.put("first_shelve_time", MapUtils.getIntValue(map, ProductIndexEsField.firstShelveTime)); |
105 | 110 |
-
Please register or login to post a comment