From ceb44477ce52b1328d5d2db241388bbc1a7778a4 Mon Sep 17 00:00:00 2001 From: huangfeng Date: Wed, 21 Feb 2024 15:04:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=9B=91=E6=B5=8B=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xydl/cac/controller/NSensorController.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xydl/cac/controller/NSensorController.java b/src/main/java/com/xydl/cac/controller/NSensorController.java index 277b523..e6c0f85 100644 --- a/src/main/java/com/xydl/cac/controller/NSensorController.java +++ b/src/main/java/com/xydl/cac/controller/NSensorController.java @@ -12,7 +12,9 @@ import com.xydl.cac.service.ParamBindService; import com.xydl.cac.service.ReportService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.Page; import org.springframework.data.repository.query.Param; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -53,12 +55,22 @@ public class NSensorController extends BasicController { } @GetMapping("listAll") - @ApiOperation("查询列表") - public Response> listAll(@Param("zsbid") Integer zsbid) throws Exception { + @ApiOperation("查询全部") + public Response> listAll(@ApiParam("主设备id") @RequestParam(value = "zsbid", required = false) Integer zsbid) throws Exception { List result = service.listAll(zsbid); return Response.success(result); } + @GetMapping("list") + @ApiOperation("查询列表") + public Response> list(@ApiParam("页码") @RequestParam(value = "pageNum", required = false) Integer pageNum, + @ApiParam("每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception { + pageNum = this.initPageNum(pageNum); + pageSize = this.initPageSize(pageSize); + Page result = service.list(pageNum, pageSize); + return Response.success(result); + } + @PostMapping("add") @ApiOperation("新增") public Response add(@Validated @RequestBody NSensor item) throws Exception {