商品搜索添加分类

This commit is contained in:
xuwenbo
2020-07-31 10:23:13 +08:00
parent 1ef4d343b7
commit 945803adb0
2 changed files with 11 additions and 1 deletions

View File

@ -25,4 +25,7 @@ public class YxStoreProductQueryCriteria{
@Query
private Integer isShow;
@Query
private Integer cateId;
}

View File

@ -77,7 +77,14 @@ public class StoreProductController {
@GetMapping(value = "/yxStoreProduct")
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_SELECT')")
public ResponseEntity getYxStoreProducts(YxStoreProductQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(yxStoreProductService.queryAll(criteria,pageable),HttpStatus.OK);
//商品分类
List<YxStoreCategory> storeCategories = yxStoreCategoryService.lambdaQuery()
.eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.list();
List<Map<String,Object>> cateList = new ArrayList<>();
Map<String, Object> queryAll = yxStoreProductService.queryAll(criteria, pageable);
queryAll.put("cateList", this.makeCate(storeCategories,cateList,0,1));
return new ResponseEntity<>(queryAll,HttpStatus.OK);
}
@ForbidSubmit