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 {