商品搜索添加分类
This commit is contained in:
@ -25,4 +25,7 @@ public class YxStoreProductQueryCriteria{
|
|||||||
|
|
||||||
@Query
|
@Query
|
||||||
private Integer isShow;
|
private Integer isShow;
|
||||||
|
|
||||||
|
@Query
|
||||||
|
private Integer cateId;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,14 @@ public class StoreProductController {
|
|||||||
@GetMapping(value = "/yxStoreProduct")
|
@GetMapping(value = "/yxStoreProduct")
|
||||||
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_SELECT')")
|
@PreAuthorize("hasAnyRole('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_SELECT')")
|
||||||
public ResponseEntity getYxStoreProducts(YxStoreProductQueryCriteria criteria, Pageable pageable){
|
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
|
@ForbidSubmit
|
||||||
|
Reference in New Issue
Block a user