...
|
...
|
@@ -2,7 +2,6 @@ package com.yoho.search.service.recall.config; |
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.yoho.search.core.personalized.models.SortBrand;
|
|
|
import com.yoho.search.service.recall.helper.StrategyHelper;
|
|
|
import com.yoho.search.service.recall.models.personal.PagePersonalFactor;
|
|
|
import com.yoho.search.service.recall.models.req.UserRecallRequest;
|
|
|
import com.yoho.search.service.recall.strategy.SortBrandType;
|
...
|
...
|
@@ -41,7 +40,7 @@ public class RecallConfigService { |
|
|
* @return
|
|
|
*/
|
|
|
public int queryStrategyConfigSize(UserRecallRequest userRecallRequest, StrategyEnum strategyEnum, int defaultSize) {
|
|
|
int size = sizeIntervalService.queryConfigSize(userRecallRequest.getPageId(),userRecallRequest.isDefaultOrder(), strategyEnum.name(), defaultSize);
|
|
|
int size = sizeIntervalService.queryConfigSize(userRecallRequest.getPageId(), userRecallRequest.isDefaultOrder(), strategyEnum.name(), defaultSize);
|
|
|
size = this.legallValue(size, 0, 200);
|
|
|
if (userRecallRequest.openDetailLog()) {
|
|
|
RECALL_LOGGER.info("queryStrategyConfigSize,pageId is [{}],isDefaultOrder is [{}], strategyEnum is [{}],size is[{}]", userRecallRequest.getPageId(), userRecallRequest.isDefaultOrder(), strategyEnum.name(), size);
|
...
|
...
|
@@ -58,19 +57,21 @@ public class RecallConfigService { |
|
|
*/
|
|
|
public int queryStrategyConfigInterval(UserRecallRequest userRecallRequest, StrategyEnum strategyEnum, int defaultInterval) {
|
|
|
int interval = sizeIntervalService.queryConfigInterval(userRecallRequest.getPageId(), userRecallRequest.isDefaultOrder(), strategyEnum.name(), defaultInterval);
|
|
|
interval = this.legallValue(interval, 2, 40);
|
|
|
interval = this.legallValue(interval, 1, 40);
|
|
|
if (userRecallRequest.openDetailLog()) {
|
|
|
RECALL_LOGGER.info("queryStrategyConfigInterval,pageId is [{}],isDefaultOrder is [{}], strategyEnum is [{}],interval is[{}]", userRecallRequest.getPageId(), userRecallRequest.isDefaultOrder(), strategyEnum.name(), interval);
|
|
|
}
|
|
|
return interval;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @param userRecallRequest
|
|
|
* @param sortBrandType
|
|
|
* @param defaultSize
|
|
|
* @return
|
|
|
*/
|
|
|
public int querySortBrandConfigCount(UserRecallRequest userRecallRequest, SortBrandType sortBrandType, int defaultSize) {
|
|
|
int size = sizeIntervalService.queryConfigSize(userRecallRequest.getPageId(), userRecallRequest.isDefaultOrder(),sortBrandType.name(), defaultSize);
|
|
|
int size = sizeIntervalService.queryConfigSize(userRecallRequest.getPageId(), userRecallRequest.isDefaultOrder(), sortBrandType.name(), defaultSize);
|
|
|
size = this.legallValue(size, 0, 30);
|
|
|
return size;
|
|
|
}
|
...
|
...
|
@@ -84,7 +85,7 @@ public class RecallConfigService { |
|
|
* @return
|
|
|
*/
|
|
|
public SortBrandSknCount queryRecallSknCount(UserRecallRequest userRecallRequest, SortBrandType sortBrandType, SortBrand sortBrand) {
|
|
|
SortBrandSknCount sortBrandSknCount = sortBrandSknCountService.queryRecallSknCount(userRecallRequest.getPageId(),userRecallRequest.isDefaultOrder(),sortBrandType.name(), sortBrand);
|
|
|
SortBrandSknCount sortBrandSknCount = sortBrandSknCountService.queryRecallSknCount(userRecallRequest.getPageId(), userRecallRequest.isDefaultOrder(), sortBrandType.name(), sortBrand);
|
|
|
if (sortBrandSknCount == null) {
|
|
|
RECALL_LOGGER.info("queryRecallSknCount,pageId is [{}],sortBrandType is [{}],sortBrand is[{}], RecallSknCount is[{}]", userRecallRequest.getPageId(), sortBrand.key(), sortBrandType.name(), "null");
|
|
|
return null;
|
...
|
...
|
|