|
@@ -4,6 +4,7 @@ import com.yonge.cooleshow.mall.common.api.CommonPage;
|
|
|
import com.yonge.cooleshow.mall.common.api.CommonResult;
|
|
|
import com.yonge.cooleshow.mbg.model.PmsProduct;
|
|
|
import com.yonge.cooleshow.portal.domain.PmsPortalProductDetail;
|
|
|
+import com.yonge.cooleshow.portal.dto.ProductSearch;
|
|
|
import com.yonge.cooleshow.portal.dto.ProductSearchConditionVo;
|
|
|
import com.yonge.cooleshow.portal.service.PmsPortalProductService;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -28,18 +29,11 @@ public class PmsPortalProductController {
|
|
|
private PmsPortalProductService portalProductService;
|
|
|
|
|
|
@ApiOperation(value = "综合搜索、筛选、排序")
|
|
|
- @ApiImplicitParam(name = "sort", value = "排序字段:0->按相关度;1->按新品;2->按销量;3->价格从低到高;4->价格从高到低",
|
|
|
- defaultValue = "0", allowableValues = "0,1,2,3,4", paramType = "query", dataType = "integer")
|
|
|
- @RequestMapping(value = "/search", method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "/search", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public CommonResult<CommonPage<PmsProduct>> search(@RequestParam(required = false) String keyword,
|
|
|
- @RequestParam(required = false) Long brandId,
|
|
|
- @RequestParam(required = false) Long productCategoryId,
|
|
|
- @RequestParam(required = false) Long productAttributeCategoryId,
|
|
|
- @RequestParam(required = false, defaultValue = "0") Integer pageNum,
|
|
|
- @RequestParam(required = false, defaultValue = "5") Integer pageSize,
|
|
|
- @RequestParam(required = false, defaultValue = "0") Integer sort) {
|
|
|
- List<PmsProduct> productList = portalProductService.search(keyword, brandId, productCategoryId,productAttributeCategoryId, pageNum, pageSize, sort);
|
|
|
+ public CommonResult<CommonPage<PmsProduct>> search(@RequestBody ProductSearch search) {
|
|
|
+ List<PmsProduct> productList = portalProductService.search(search.getKeyword(),search.getBrandId(),search.getProductCategoryId(),
|
|
|
+ search.getProductAttributeCategoryId(), search.getPageNum(), search.getPageSize(), search.getSort());
|
|
|
return CommonResult.success(CommonPage.restPage(productList));
|
|
|
}
|
|
|
|