Authored by hugufei

拆包

Showing 18 changed files with 70 additions and 70 deletions
... ... @@ -12,11 +12,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.yoho.search.common.utils.HttpServletRequestUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.shopbrand.BrandService;
import com.yoho.search.service.scene.general.ProductCountService;
import com.yoho.search.service.scene.general.ProductIndexAggService;
import com.yoho.search.service.scene.general.SelectionsForApp;
import com.yoho.search.service.scene.general.SelectionsForPc;
import com.yoho.search.service.scene.pages.selections.AppSelectionsService;
import com.yoho.search.service.scene.pages.selections.PcSelectionsService;
@Controller
@RequestMapping(value = "/productindex")
... ... @@ -25,9 +24,9 @@ public class ProductIndexController {
@Autowired
private ProductIndexAggService productIndexAggService;
@Autowired
private SelectionsForPc selectionsWithAdvanceService;
private PcSelectionsService selectionsWithAdvanceService;
@Autowired
private SelectionsForApp selectionsWithOutAdvanceService;
private AppSelectionsService selectionsWithOutAdvanceService;
@Autowired
private ProductCountService productCountService;
... ...
... ... @@ -3,6 +3,7 @@ package com.yoho.search.service.scene.general;
import java.util.HashMap;
import java.util.Map;
import com.yoho.search.service.scene.pages.selections.PcSelectionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -13,7 +14,7 @@ import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
public class SearchProductsServiceNew {
@Autowired
private SelectionsForPc selectionsForPc;
private PcSelectionsService pcSelectionsService;
@Autowired
private ProductListSwitchService productListSwitchService;
... ... @@ -25,7 +26,7 @@ public class SearchProductsServiceNew {
result.putAll((Map<String, Object>) productList.getData());
}
if (paramMap.containsKey("needFilter") && "1".equals(paramMap.get("needFilter"))) {
result.putAll((Map<String, Object>) selectionsForPc.getSelectionsForPc(paramMap).getData());
result.putAll((Map<String, Object>) pcSelectionsService.getSelectionsForPc(paramMap).getData());
}
return new SearchApiResult().setData(result);
}
... ...
... ... @@ -5,7 +5,7 @@ import com.yoho.search.common.utils.SearchApiResultUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -25,7 +25,7 @@ public class BrandPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Override
public String pageId() {
... ... @@ -65,7 +65,7 @@ public class BrandPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=BrandAggregations][params=" + paramMap + "]", e);
... ...
... ... @@ -17,7 +17,7 @@ import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.index.SizeIndexBaseService;
import com.yoho.search.service.helper.SearchParamHelper;
import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
... ... @@ -52,7 +52,7 @@ public class BreakSizePageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
/**
* 为断码区添加默认的过滤条件
... ... @@ -91,7 +91,7 @@ public class BreakSizePageSceneService extends AbstractPageSceneService {
// 2、返回聚合结果
List<IAggregation> aggregation = sceneSelectionsService.getBreakSizeAggregations(paramMap);
SearchApiResult result = sceneSelectionsService.aggregations(paramMap, aggregation);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=Couponaggregations][params=" + paramMap + "]", e);
... ...
... ... @@ -4,7 +4,7 @@ import com.yoho.search.base.utils.SearchPageIdDefine;
import com.yoho.search.common.utils.SearchApiResultUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.sknimg.SknImgsCacheBean;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.slf4j.Logger;
... ... @@ -24,7 +24,7 @@ public class CommonPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Autowired
private SknImgsCacheBean sknImgsCacheBean;
... ... @@ -58,7 +58,7 @@ public class CommonPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=Couponaggregations][params=" + paramMap + "]", e);
... ...
... ... @@ -4,7 +4,7 @@ import com.yoho.search.base.utils.SearchPageIdDefine;
import com.yoho.search.common.utils.SearchApiResultUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -23,7 +23,7 @@ public class CouponPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Override
public String pageId() {
... ... @@ -56,7 +56,7 @@ public class CouponPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=Couponaggregations][params=" + paramMap + "]", e);
... ...
... ... @@ -9,8 +9,8 @@ import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.helper.SearchCommonHelper;
import com.yoho.search.service.helper.SearchKeyWordHelper;
import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
import com.yoho.search.service.scene.pages.selections.SceneAggregationsHelper;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneAggregationHelper;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import com.yoho.search.service.scene.suggest.RecommendWordsService;
import org.apache.commons.lang.StringUtils;
... ... @@ -40,9 +40,9 @@ public class FuzzySceneService extends AbstractPageSceneService {
@Autowired
private SearchKeyWordHelper searchKeyWordService;
@Autowired
private SceneAggregationsHelper sceneAggregationsHelper;
private SceneAggregationHelper sceneAggregationHelper;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Autowired
private ProductListSwitchService productListSwitchService;
... ... @@ -79,9 +79,9 @@ public class FuzzySceneService extends AbstractPageSceneService {
// 3、获取商品列表
CompletableFuture<SearchApiResult> productListuture = CompletableFuture.supplyAsync(() -> productListSwitchService.fuzzyProductList(this.newParamMap(paramMap)), executor);
// 4、获取自定义标签聚合结果
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.sceneAggCustomizeTag(this.newParamMap(paramMap)), executor);
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> sceneAggregationHelper.sceneAggCustomizeTag(this.newParamMap(paramMap)), executor);
// 5、获取促销专题
CompletableFuture<SearchApiResult> promotionsFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.sceneAggPromotion(this.newParamMap(paramMap)),
CompletableFuture<SearchApiResult> promotionsFuture = CompletableFuture.supplyAsync(() -> sceneAggregationHelper.sceneAggPromotion(this.newParamMap(paramMap)),
executor);
// 6、加入建议词
... ... @@ -99,7 +99,7 @@ public class FuzzySceneService extends AbstractPageSceneService {
SearchApiResult promotions = promotionsFuture.get();
JSONObject dataMap = (JSONObject) productListResult.getData();
dataMap.put(CUSTOMIZE_TAG_LIST, customizeTags.getData());
dataMap.put(RECOMMEND_PROMOTION_LIST, sceneAggregationsHelper.subRecommendPromotions(promotions.getData(),this.getPage(paramMap),1));
dataMap.put(RECOMMEND_PROMOTION_LIST, sceneAggregationHelper.subRecommendPromotions(promotions.getData(),this.getPage(paramMap),1));
return productListResult;
} catch (Exception e) {
logger.error(e.getMessage(), e);
... ... @@ -118,7 +118,7 @@ public class FuzzySceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error(e.getMessage(), e);
... ...
... ... @@ -8,7 +8,7 @@ import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.helper.SearchCommonHelper;
import com.yoho.search.service.helper.SearchKeyWordHelper;
import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
... ... @@ -32,7 +32,7 @@ public class MiniappFuzzyPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Autowired
private ProductListSwitchService productListSwitchService;
... ... @@ -94,7 +94,7 @@ public class MiniappFuzzyPageSceneService extends AbstractPageSceneService {
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
if(result!=null){
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
}
return result;
} catch (Exception e) {
... ...
... ... @@ -4,7 +4,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -29,7 +29,7 @@ public class NewArrivalPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Override
public String pageId() {
... ... @@ -65,7 +65,7 @@ public class NewArrivalPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=NewArrivalAggregations][params=" + paramMap + "]", e);
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.service.scene.pages;
import java.util.Map;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
... ... @@ -26,7 +26,7 @@ public class ProductPoolPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
/**
*
... ... @@ -90,7 +90,7 @@ public class ProductPoolPageSceneService extends AbstractPageSceneService {
try {
this.addParamsToParamMap(paramMap);
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=PoolAggregations][params=" + paramMap + "]", e);
... ...
... ... @@ -3,7 +3,7 @@ package com.yoho.search.service.scene.pages;
import java.util.List;
import java.util.Map;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -28,7 +28,7 @@ public class ShopPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Override
public String pageId() {
... ... @@ -68,7 +68,7 @@ public class ShopPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=ShopAggregations][params=" + paramMap + "]", e);
... ...
... ... @@ -5,8 +5,8 @@ import com.yoho.search.base.utils.SearchPageIdDefine;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.common.SearchRequestParams;
import com.yoho.search.service.scene.pages.entrance.ProductListSwitchService;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneAggregationsHelper;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneAggregationHelper;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
... ... @@ -29,9 +29,9 @@ public class SortPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneAggregationsHelper sceneAggregationsHelper;
private SceneAggregationHelper sceneAggregationHelper;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Override
public String pageId() {
... ... @@ -78,11 +78,11 @@ public class SortPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
CompletableFuture<SearchApiResult> productListFuture = CompletableFuture.supplyAsync(() -> sceneProductListService.productList(this.newParamMap(paramMap)), executorService);
// 2、获取聚合结果
CompletableFuture<SearchApiResult> standardsFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.sceneAggStandard(this.newParamMap(paramMap)),
CompletableFuture<SearchApiResult> standardsFuture = CompletableFuture.supplyAsync(() -> sceneAggregationHelper.sceneAggStandard(this.newParamMap(paramMap)),
executorService);
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.sceneAggCustomizeTag(this.newParamMap(paramMap)),
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> sceneAggregationHelper.sceneAggCustomizeTag(this.newParamMap(paramMap)),
executorService);
CompletableFuture<SearchApiResult> promotionsFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.sceneAggPromotion(this.newParamMap(paramMap)),
CompletableFuture<SearchApiResult> promotionsFuture = CompletableFuture.supplyAsync(() -> sceneAggregationHelper.sceneAggPromotion(this.newParamMap(paramMap)),
executorService);
// 3、组合结果
SearchApiResult productList = productListFuture.get();
... ... @@ -92,7 +92,7 @@ public class SortPageSceneService extends AbstractPageSceneService {
JSONObject jsonObject = (JSONObject) productList.getData();
jsonObject.put(STANDARD, standards.getData());
jsonObject.put(CUSTOMIZE_TAG_LIST, customizeTags.getData());
jsonObject.put(RECOMMEND_PROMOTION_LIST, sceneAggregationsHelper.subRecommendPromotions(promotions.getData(), this.getPage(paramMap), 1));
jsonObject.put(RECOMMEND_PROMOTION_LIST, sceneAggregationHelper.subRecommendPromotions(promotions.getData(), this.getPage(paramMap), 1));
return productList;
} catch (Exception e) {
logger.error(e.getMessage(), e);
... ... @@ -111,7 +111,7 @@ public class SortPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error(e.getMessage(), e);
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.service.scene.pages;
import java.util.Map;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
... ... @@ -26,7 +26,7 @@ public class ZqPageSceneService extends AbstractPageSceneService {
@Autowired
private SceneSelectionsService sceneSelectionsService;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Override
public String pageId() {
... ... @@ -66,7 +66,7 @@ public class ZqPageSceneService extends AbstractPageSceneService {
this.addParamsToParamMap(paramMap);
// 2、返回聚合结果
SearchApiResult result = sceneSelectionsService.aggregations(paramMap);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error("[func=zqProductList][params=" + paramMap + "]", e);
... ...
... ... @@ -6,8 +6,8 @@ import java.util.Map;
import com.yoho.search.base.utils.CollectionUtils;
import com.yoho.search.models.RecommendPromotionAggVO;
import com.yoho.search.service.scene.pages.selections.SceneAggregationsHelper;
import com.yoho.search.service.scene.pages.selections.SceneRecommendBrandsService;
import com.yoho.search.service.scene.pages.selections.SceneAggregationHelper;
import com.yoho.search.service.scene.pages.selections.SceneSelectionsBrandsService;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
import org.elasticsearch.search.aggregations.Aggregation;
... ... @@ -35,8 +35,8 @@ import com.yoho.search.service.scene.pages.selections.SceneSelectionsService;
import com.yoho.search.service.scene.shopbrand.BrandService;
import com.yoho.search.service.scene.general.DiscountService;
import com.yoho.search.service.scene.general.SearchSortGroupService;
import com.yoho.search.service.scene.general.SelectionsForApp;
import com.yoho.search.service.scene.general.SelectionsForPc;
import com.yoho.search.service.scene.pages.selections.AppSelectionsService;
import com.yoho.search.service.scene.pages.selections.PcSelectionsService;
@Service
public class PromotionAggregationsService extends AbstractCacheAbleService {
... ... @@ -48,11 +48,11 @@ public class PromotionAggregationsService extends AbstractCacheAbleService {
@Autowired
private AggregationFactory aggregationFactory;
@Autowired
private SelectionsForApp selectionsWithOutAdvanceService;
private AppSelectionsService selectionsWithOutAdvanceService;
@Autowired
private SearchAfterCacheHelper searchAfterCacheService;
@Autowired
private SelectionsForPc selectionsForPc;
private PcSelectionsService pcSelectionsService;
@Autowired
private BrandService brandService;
@Autowired
... ... @@ -66,9 +66,9 @@ public class PromotionAggregationsService extends AbstractCacheAbleService {
@Autowired
private PromotionSceneHelper promotionSceneHelper;
@Autowired
private SceneRecommendBrandsService sceneRecommendBrandsService;
private SceneSelectionsBrandsService sceneSceneSelectionsBrandsService;
@Autowired
private SceneAggregationsHelper sceneAggregationsHelper;
private SceneAggregationHelper sceneAggregationHelper;
@Override
public SearchCache getSearchCache() {
... ... @@ -154,7 +154,7 @@ public class PromotionAggregationsService extends AbstractCacheAbleService {
BoolQueryBuilder mustFilterByPromotion = promotionSceneHelper.getMustFilterByPromotion(promotionConditions);
// 2、调通用的PC聚合逻辑
SearchApiResult apiResult = selectionsForPc.getSelectionsForPc(paramMap, mustFilterByPromotion);
SearchApiResult apiResult = pcSelectionsService.getSelectionsForPc(paramMap, mustFilterByPromotion);
if (apiResult == null || apiResult.getData() == null) {
return apiResult;
}
... ... @@ -196,7 +196,7 @@ public class PromotionAggregationsService extends AbstractCacheAbleService {
// 0、解析promotion的限制条件
BoolQueryBuilder mustFilter = promotionSceneHelper.getMustFilterByPromotion(promotionConditions);
SearchApiResult result = sceneSelectionsService.aggregations(paramMap, mustFilter);
sceneRecommendBrandsService.getRecommendBrands(paramMap, result);
sceneSceneSelectionsBrandsService.getRecommendBrands(paramMap, result);
return result;
} catch (Exception e) {
logger.error(e.getMessage(), e);
... ... @@ -207,7 +207,7 @@ public class PromotionAggregationsService extends AbstractCacheAbleService {
public SearchApiResult aggPromotions(Map<String, String> paramMap){
int size = 10;
JSONObject jsonObject = new JSONObject();
List<RecommendPromotionAggVO> recommendPromotionAggVOS = sceneAggregationsHelper.aggPromotion(paramMap);
List<RecommendPromotionAggVO> recommendPromotionAggVOS = sceneAggregationHelper.aggPromotion(paramMap);
if (recommendPromotionAggVOS.size() > size) {
jsonObject.put("promotionList", CollectionUtils.safeSubList(recommendPromotionAggVOS, 0, size));
} else {
... ...
package com.yoho.search.service.scene.general;
package com.yoho.search.service.scene.pages.selections;
import java.util.*;
import java.util.Map.Entry;
... ... @@ -30,7 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SelectionsForApp extends AbstractCacheAbleService {
public class AppSelectionsService extends AbstractCacheAbleService {
@Autowired
private SearchParamHelper searchParamHelper;
... ...
package com.yoho.search.service.scene.general;
package com.yoho.search.service.scene.pages.selections;
import java.util.*;
import java.util.Map.Entry;
... ... @@ -36,7 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SelectionsForPc extends AbstractCacheAbleService {
public class PcSelectionsService extends AbstractCacheAbleService {
@Autowired
private SearchParamHelper searchParamHelper;
... ... @@ -62,7 +62,7 @@ public class SelectionsForPc extends AbstractCacheAbleService {
return searchCacheFactory.getSelectionsForPcCache();
}
private static Logger logger = LoggerFactory.getLogger(SelectionsForPc.class);
private static Logger logger = LoggerFactory.getLogger(PcSelectionsService.class);
public SearchApiResult getSelectionsForPc(Map<String, String> paramMap) {
try {
... ...
... ... @@ -21,9 +21,9 @@ import org.springframework.stereotype.Component;
import java.util.*;
@Component
public class SceneAggregationsHelper {
public class SceneAggregationHelper {
private static final Logger logger = LoggerFactory.getLogger(SceneAggregationsHelper.class);
private static final Logger logger = LoggerFactory.getLogger(SceneAggregationHelper.class);
@Autowired
private AggregationFactory aggregationFactory;
... ...
... ... @@ -19,7 +19,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class SceneRecommendBrandsService {
public class SceneSelectionsBrandsService {
@Autowired
private UserPersionalFactorComponent userPersionalFactorComponent;
... ...