Authored by hugufei

PC也返回cover1,cover2,方便gateway兼容

... ... @@ -7,6 +7,7 @@ import java.util.Map;
import javax.annotation.PostConstruct;
import com.yoho.search.service.helper.GoodsCoverHelper;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -21,6 +22,8 @@ public class WebProductIndexBaseService {
@Autowired
private ProductPricePlanIndexBaseService productPricePlanIndexBaseService;
@Autowired
private GoodsCoverHelper goodsCoverHelper;
// 获取从source中不返回的字段定义,用以节省带宽
private List<String> productIndexIncludeFields = new ArrayList<String>();
... ... @@ -100,6 +103,8 @@ public class WebProductIndexBaseService {
productMap.put("vip3_price", MapUtils.getDoubleValue(map, ProductIndexEsField.vip3Price, 0));
productMap.put("vip_discount_type", MapUtils.getIntValue(map, ProductIndexEsField.vipDiscountType, 1));
// 把gateway逻辑抽过来,抽取cover1,cover2
goodsCoverHelper.buildGoodsCover(map, productMap);
productMap.put("default_images", MapUtils.getString(map, ProductIndexEsField.defaultImages, ""));
productMap.put("first_shelve_time", MapUtils.getIntValue(map, ProductIndexEsField.firstShelveTime));
... ...