Authored by hugufei

品类页添加uid尾数配置【uid尾数为5的】

@@ -182,12 +182,25 @@ public class SearchDynamicConfigService { @@ -182,12 +182,25 @@ public class SearchDynamicConfigService {
182 } 182 }
183 183
184 /** 184 /**
  185 + * 品类页召回时使用的uid[尾数]
  186 + */
  187 + public boolean isGoToSortRecallUser(int uid) {
  188 + String uidMantissas = configReader.getString("search.sortpage.recall.uid.mantissa", "5");
  189 + if(uidMantissas.contains(String.valueOf(uid % 10))){
  190 + return true;
  191 + }
  192 + return false;
  193 + }
  194 +
  195 + /**
185 * 召回时是否使用全局品牌id 196 * 召回时是否使用全局品牌id
186 */ 197 */
187 public boolean isSortPageRecallUseGlobalBrand() { 198 public boolean isSortPageRecallUseGlobalBrand() {
188 return configReader.getBoolean("search.sortpage.recall.use_global_brand", false); 199 return configReader.getBoolean("search.sortpage.recall.use_global_brand", false);
189 } 200 }
190 201
  202 +
  203 +
191 /** 204 /**
192 * 个性化降级配置 205 * 个性化降级配置
193 */ 206 */
@@ -90,7 +90,7 @@ public class SortSceneService extends AbstractSceneService { @@ -90,7 +90,7 @@ public class SortSceneService extends AbstractSceneService {
90 this.addParamsToParamMap(paramMap); 90 this.addParamsToParamMap(paramMap);
91 CompletableFuture<SearchApiResult> productListFuture = null; 91 CompletableFuture<SearchApiResult> productListFuture = null;
92 // 2、获取商品列表-是否使用召回策略 92 // 2、获取商品列表-是否使用召回策略
93 - if (searchDynamicConfigService.isSortPageRecallOpen() && searchCommonHelper.isOrderEmpty(paramMap) && searchCommonHelper.hasUid(paramMap)) { 93 + if (goToRecall(paramMap)) {
94 productListFuture = CompletableFuture.supplyAsync(() -> sortRecallSceneService.productList(this.newParamMap(paramMap)), executorService); 94 productListFuture = CompletableFuture.supplyAsync(() -> sortRecallSceneService.productList(this.newParamMap(paramMap)), executorService);
95 } else { 95 } else {
96 productListFuture = CompletableFuture.supplyAsync(() -> sceneProductListService.productList(this.newParamMap(paramMap)), executorService); 96 productListFuture = CompletableFuture.supplyAsync(() -> sceneProductListService.productList(this.newParamMap(paramMap)), executorService);
@@ -117,6 +117,23 @@ public class SortSceneService extends AbstractSceneService { @@ -117,6 +117,23 @@ public class SortSceneService extends AbstractSceneService {
117 } 117 }
118 } 118 }
119 119
  120 + private boolean goToRecall(Map<String, String> paramMap) {
  121 + if (!searchDynamicConfigService.isSortPageRecallOpen()) {
  122 + return false;
  123 + }
  124 + if (!searchCommonHelper.isOrderEmpty(paramMap) && searchCommonHelper.hasUid(paramMap)) {
  125 + return false;
  126 + }
  127 + int uid = searchCommonHelper.getUid(paramMap);
  128 + if (uid <= 0) {
  129 + return false;
  130 + }
  131 + if (!searchDynamicConfigService.isGoToSortRecallUser(uid)) {
  132 + return false;
  133 + }
  134 + return true;
  135 + }
  136 +
120 @Override 137 @Override
121 public SearchApiResult aggregations(Map<String, String> paramMap) { 138 public SearchApiResult aggregations(Map<String, String> paramMap) {
122 try { 139 try {
@@ -38,6 +38,7 @@ search.suggestion.tips.conversion.open=true @@ -38,6 +38,7 @@ search.suggestion.tips.conversion.open=true
38 #recall 38 #recall
39 search.sortpage.recall.open=true 39 search.sortpage.recall.open=true
40 search.sortpage.recall.use_global_brand=false 40 search.sortpage.recall.use_global_brand=false
  41 +search.sortpage.recall.uid.mantissa=5
41 42
42 #rateLimit 43 #rateLimit
43 search.persional.rateLimit.brand.productList=100:2 44 search.persional.rateLimit.brand.productList=100:2