Authored by Lixiaodi

增加rankType

... ... @@ -203,10 +203,11 @@ public class ProductSearchController {
@IgnoreSession
@Cachable(expire = 180)
public ApiResponse searchUvscoreProductList(
@RequestParam(value = "rankType", required = false, defaultValue = "a") String rankType,
@RequestParam(value = "limit", required = false)Integer limit,
@RequestParam(value = "page", required = false)Integer page) {
ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page);
ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setRankType(rankType);
LOG.info("in method=ufo.product.search.uvscoreProductList req={}", req.toString());
JSONObject resp = productSearchService.searchUvscoreProductList(req);
... ...
... ... @@ -92,6 +92,8 @@ public final class SearchConstants {
String CONTAIN_YOHO = "contain_yoho";
String RANK_TYPE = "rankType";
}
}
... ...
... ... @@ -36,6 +36,7 @@ public class SearchParam {
orderMap.put("pools_id_desc", "pools.order_by:desc");
orderMap.put("sale_asc", "salesNum:asc");
orderMap.put("sale_desc", "salesNum:desc");
orderMap.put("st_desc", "saleTime:desc");
}
/**
... ... @@ -53,7 +54,8 @@ public class SearchParam {
.setBrandSeries(req.getSeries()).setGender(req.getGender()).setFilterYearMonth(req.getFilterYearMonth())
.setStartTime(req.getStartTime())
.setEndTime(req.getEndTime())
.setContainYoho(req.getContainYoho());
.setContainYoho(req.getContainYoho())
.setRankType(req.getRankType());
return this;
}
... ... @@ -65,7 +67,8 @@ public class SearchParam {
.setFilterYearMonth(req.getFilterYearMonth())
.setStartTime(req.getStartTime())
.setEndTime(req.getEndTime())
.setContainYoho(req.getContainYoho());
.setContainYoho(req.getContainYoho())
.setRankType(req.getRankType());
return this;
}
... ... @@ -198,14 +201,14 @@ public class SearchParam {
}
return this;
}
public SearchParam setFilterYearMonth(String yearMonth) {
if (StringUtils.isNotBlank(yearMonth)) {
param.put(SearchConstants.IndexNameConstant.FILTER_YEAR_MONTH, yearMonth);
}
return this;
}
public SearchParam setStartTime(Integer startTime) {
if (startTime != null) {
param.put(SearchConstants.IndexNameConstant.START_TIME, startTime);
... ... @@ -259,6 +262,13 @@ public class SearchParam {
return this;
}
public SearchParam setRankType(String rankType) {
if (StringUtils.isNotEmpty(rankType)) {
param.put(SearchConstants.IndexNameConstant.RANK_TYPE, rankType);
}
return this;
}
public Map<String, Object> getParam() {
return param;
}
... ...
... ... @@ -24,6 +24,7 @@ public class ProductSearchReq {
private Integer endTime;
private Integer searchType;
private String containYoho;//是否包含有货商品
private String rankType;
@Override
public String toString() {
... ... @@ -234,6 +235,13 @@ public class ProductSearchReq {
this.containYoho = containYoho;
return this;
}
public String getRankType() {
return rankType;
}
public ProductSearchReq setRankType(String rankType) {
this.rankType = rankType;
return this;
}
}
... ...