fix PromotionServiceImpl
Showing
1 changed file
with
3 additions
and
5 deletions
@@ -25,6 +25,7 @@ import com.yoho.search.core.es.model.SearchParam; | @@ -25,6 +25,7 @@ import com.yoho.search.core.es.model.SearchParam; | ||
25 | import com.yoho.search.core.es.model.SearchResult; | 25 | import com.yoho.search.core.es.model.SearchResult; |
26 | import com.yoho.search.service.aggregations.impls.AggregationFactoryService; | 26 | import com.yoho.search.service.aggregations.impls.AggregationFactoryService; |
27 | import com.yoho.search.service.cache.SearchCacheFactory; | 27 | import com.yoho.search.service.cache.SearchCacheFactory; |
28 | +import com.yoho.search.service.cache.SearchCacheMatchLogger; | ||
28 | import com.yoho.search.service.cache.model.SearchCache; | 29 | import com.yoho.search.service.cache.model.SearchCache; |
29 | import com.yoho.search.service.service.SearchCacheService; | 30 | import com.yoho.search.service.service.SearchCacheService; |
30 | import com.yoho.search.service.service.SearchCommonService; | 31 | import com.yoho.search.service.service.SearchCommonService; |
@@ -37,7 +38,6 @@ import com.yoho.search.service.servicenew.IPromotionService; | @@ -37,7 +38,6 @@ import com.yoho.search.service.servicenew.IPromotionService; | ||
37 | import com.yoho.search.service.servicenew.ISearchSortGroupService; | 38 | import com.yoho.search.service.servicenew.ISearchSortGroupService; |
38 | import com.yoho.search.service.servicenew.ISelectionsForApp; | 39 | import com.yoho.search.service.servicenew.ISelectionsForApp; |
39 | import com.yoho.search.service.servicenew.ISelectionsForPc; | 40 | import com.yoho.search.service.servicenew.ISelectionsForPc; |
40 | -import com.yoho.search.service.utils.HttpServletRequestUtils; | ||
41 | import com.yoho.search.service.vo.PromotionConditions; | 41 | import com.yoho.search.service.vo.PromotionConditions; |
42 | import com.yoho.search.service.vo.PromotionParam; | 42 | import com.yoho.search.service.vo.PromotionParam; |
43 | import com.yoho.search.service.vo.SearchApiResult; | 43 | import com.yoho.search.service.vo.SearchApiResult; |
@@ -45,8 +45,6 @@ import com.yoho.search.service.vo.SearchApiResult; | @@ -45,8 +45,6 @@ import com.yoho.search.service.vo.SearchApiResult; | ||
45 | @Service | 45 | @Service |
46 | public class PromotionServiceImpl implements IPromotionService { | 46 | public class PromotionServiceImpl implements IPromotionService { |
47 | 47 | ||
48 | - private static Logger CACHE_MATCH_REQUEST = LoggerFactory.getLogger("CACHE_MATCH_REQUEST"); | ||
49 | - | ||
50 | private static Logger logger = LoggerFactory.getLogger(PromotionServiceImpl.class); | 48 | private static Logger logger = LoggerFactory.getLogger(PromotionServiceImpl.class); |
51 | 49 | ||
52 | @Autowired | 50 | @Autowired |
@@ -237,7 +235,7 @@ public class PromotionServiceImpl implements IPromotionService { | @@ -237,7 +235,7 @@ public class PromotionServiceImpl implements IPromotionService { | ||
237 | final String productIndexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX; | 235 | final String productIndexName = ISearchConstants.INDEX_NAME_PRODUCT_INDEX; |
238 | JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(productListSearchCache, productIndexName, searchParam); | 236 | JSONObject cacheObject = searchCacheService.getJSONObjectFromCache(productListSearchCache, productIndexName, searchParam); |
239 | if (cacheObject != null) { | 237 | if (cacheObject != null) { |
240 | - CACHE_MATCH_REQUEST.info("match cache , url is :/promotion/list.json?" + HttpServletRequestUtils.genParamString(paramMap)); | 238 | + SearchCacheMatchLogger.doSearchCacheMatchLog("/promotion/list.json", paramMap); |
241 | return new SearchApiResult().setData(cacheObject); | 239 | return new SearchApiResult().setData(cacheObject); |
242 | } | 240 | } |
243 | 241 | ||
@@ -289,7 +287,7 @@ public class PromotionServiceImpl implements IPromotionService { | @@ -289,7 +287,7 @@ public class PromotionServiceImpl implements IPromotionService { | ||
289 | if (cacheObject != null) { | 287 | if (cacheObject != null) { |
290 | Object newCacheObject = searchAfterCacheService.dealFilterCacheObject(cacheObject); | 288 | Object newCacheObject = searchAfterCacheService.dealFilterCacheObject(cacheObject); |
291 | newCacheObject = searchAfterCacheService.dealDiscountCacheObject((JSONObject) newCacheObject); | 289 | newCacheObject = searchAfterCacheService.dealDiscountCacheObject((JSONObject) newCacheObject); |
292 | - CACHE_MATCH_REQUEST.info("match cache , url is :/promotion/selections.json?" + HttpServletRequestUtils.genParamString(paramMap)); | 290 | + SearchCacheMatchLogger.doSearchCacheMatchLog("/promotion/selections.json", paramMap); |
293 | return new SearchApiResult().setData(newCacheObject); | 291 | return new SearchApiResult().setData(newCacheObject); |
294 | } | 292 | } |
295 | 293 |
-
Please register or login to post a comment