Commit 69714e81 authored by 廖旭伟's avatar 廖旭伟

修改h5产品列表接口

parent 61762e91
......@@ -18,5 +18,9 @@ public class ProductReq extends BaseReq {
* 分类id
*/
private Long categoryId;
/**
* 是否热门(0.否,1.是)
*/
private Integer hot;
}
......@@ -84,12 +84,13 @@ public class ProductApiController extends AbstractBaseController<ProductReq>{
if(!ObjectUtils.isEmpty(productReq.getCategoryId())){
query.setCategoryId(String.valueOf(productReq.getCategoryId()));
}
query.setHot(productReq.getHot());
query.setOrderColList(Arrays.asList(new OrderCol("createTime", OrderCol.DESCENDING)));
Result<ProductEntity> result = productService.find(query, pageInfo, context);
List<ProductEntity> collect = result.getList().stream().map(item -> {
ProductEntity productEntity = new ProductEntity();
BeanUtils.copyProperties(item, productEntity, BeanUtil.getNullPropertyNames(item));
productEntity.setProductDetail(null);
return productEntity;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment