使用IPage可以给前端返回规范的JSON格式数据
代码使用示例:
@ApiOperation("分页查询所有数据")
@GetMapping
public Result<IPage<DailyProductionSchedulingPlan>> selectAll(Page<DailyProductionSchedulingPlan> page, DailyProductionSchedulingPlan dailyProductionSchedulingPlan) {
return Result.OK(this.dailyProductionSchedulingPlanService.page(page, new QueryWrapper<>(dailyProductionSchedulingPlan)));
}
第二个参数为对象,该对象的所有属性值都是非必传的,前端传参可以任意传该对象中的任意属性
返回的JSON格式
使用IPage还有一个好处是:它会显示数量总数total,可以分页