Authored by 胡古飞

代码优化

... ... @@ -52,10 +52,7 @@ public class UfoProductListController {
public SearchApiResult productList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
if (checkPageParam != null) {
return checkPageParam;
}
return ufoProductListService.productList(paramMap);
return checkPageParam != null ? checkPageParam : ufoProductListService.productList(paramMap);
}
// 模糊搜索列表
... ... @@ -63,10 +60,7 @@ public class UfoProductListController {
public SearchApiResult fuzzyProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
if (checkPageParam != null) {
return checkPageParam;
}
return ufoFuzzySceneService.fuzzyProductList(paramMap);
return checkPageParam != null ? checkPageParam : ufoFuzzySceneService.fuzzyProductList(paramMap);
}
// 首页uvscore排序列表
... ... @@ -74,10 +68,7 @@ public class UfoProductListController {
public SearchApiResult uvscoreProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
if (checkPageParam != null) {
return checkPageParam;
}
return ufoUVScoreSceneService.uvScoreProductList(paramMap);
return checkPageParam != null ? checkPageParam : ufoUVScoreSceneService.uvScoreProductList(paramMap);
}
// 商品池列表
... ... @@ -85,21 +76,7 @@ public class UfoProductListController {
public SearchApiResult poolProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
if (checkPageParam != null) {
return checkPageParam;
}
return ufoPoolSceneService.poolProductList(paramMap);
}
// 用户收藏列表,按一堆id查询
@RequestMapping(method = RequestMethod.GET, value = "/ufo/favoriteProductList")
public SearchApiResult favoriteProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
if (checkPageParam != null) {
return checkPageParam;
}
return ufoFavoriteService.favoriteProductList(paramMap);
return checkPageParam != null ? checkPageParam : ufoPoolSceneService.poolProductList(paramMap);
}
//热销排行榜列表
... ... @@ -107,10 +84,7 @@ public class UfoProductListController {
public SearchApiResult hotSaleProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
if (checkPageParam != null) {
return checkPageParam;
}
return ufoHotSaleListService.hotSaleProductList(paramMap);
return checkPageParam != null ? checkPageParam : ufoHotSaleListService.hotSaleProductList(paramMap);
}
// UFO - 即将发售列表
... ... @@ -118,10 +92,15 @@ public class UfoProductListController {
public SearchApiResult soonSaleProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
if (checkPageParam != null) {
return checkPageParam;
}
return ufoSoonSaleService.soonSaleProductList(paramMap);
return checkPageParam != null ? checkPageParam : ufoSoonSaleService.soonSaleProductList(paramMap);
}
// 用户收藏列表,按一堆id查询
@RequestMapping(method = RequestMethod.GET, value = "/ufo/favoriteProductList")
public SearchApiResult favoriteProductList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
SearchApiResult checkPageParam = this.checkPageParam(paramMap);
return checkPageParam != null ? checkPageParam : ufoFavoriteService.favoriteProductList(paramMap);
}
}
... ...
... ... @@ -20,7 +20,7 @@ public class UfoRecommendController {
/**
* 详情页的商品推荐一(根据:名称、品类、品牌)
*/
@RequestMapping(method = RequestMethod.GET, value = "/ufo/recommendList")
@RequestMapping(method = RequestMethod.GET, value = "/ufo/recommendList")
public SearchApiResult recommendList(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return ufoRecommendService.recommendList(paramMap);
... ...