mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-22 20:54:26 +08:00
fix: 商品分页默认参数
This commit is contained in:
parent
a4caa73d06
commit
41703b1f7e
@ -38,7 +38,12 @@ public class GoodsController {
|
|||||||
@ApiImplicitParam(name = "isAsc", value = "是否升序", example = "false", paramType = "query", dataType = "Boolean")
|
@ApiImplicitParam(name = "isAsc", value = "是否升序", example = "false", paramType = "query", dataType = "Boolean")
|
||||||
})
|
})
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public Result list(Integer page, Integer limit, String name, Long categoryId, String orderBy, Boolean isAsc) {
|
public Result<List<GoodsVO>> list(@RequestParam(name = "page", defaultValue = "1") Integer page,
|
||||||
|
@RequestParam(name = "limit", defaultValue = "10") Integer limit,
|
||||||
|
String name,
|
||||||
|
Long categoryId,
|
||||||
|
@RequestParam(name = "orderBy", defaultValue = "id") String orderBy,
|
||||||
|
@RequestParam(name = "isAsc", defaultValue = "false") Boolean isAsc) {
|
||||||
Page<PmsSpu> pageResult = goodsService.page(new Page<>(page, limit), new QueryWrapper<PmsSpu>()
|
Page<PmsSpu> pageResult = goodsService.page(new Page<>(page, limit), new QueryWrapper<PmsSpu>()
|
||||||
.eq(categoryId != null, "category_id", categoryId)
|
.eq(categoryId != null, "category_id", categoryId)
|
||||||
.like(StrUtil.isNotBlank(name), "name", name)
|
.like(StrUtil.isNotBlank(name), "name", name)
|
||||||
|
Loading…
Reference in New Issue
Block a user