From 546915fc4b7267c16b2384809b0ca4f43ca33f3e Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期日, 09 十月 2022 08:50:14 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/sys/ArgsController.java | 35 ++++++++++++++++++++++++++++++----- 1 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/lf/server/controller/sys/ArgsController.java b/src/main/java/com/lf/server/controller/sys/ArgsController.java index 0608569..b5343bd 100644 --- a/src/main/java/com/lf/server/controller/sys/ArgsController.java +++ b/src/main/java/com/lf/server/controller/sys/ArgsController.java @@ -65,6 +65,31 @@ } @SysLog() + @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = "鏈夋晥鏈�"), + @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), + @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1") + }) + @GetMapping(value = "/selectByPageAndCount") + public ResponseMsg<List<ArgsEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { + try { + if (pageSize < 1 || pageIndex < 1) { + return fail("姣忛〉椤垫暟鎴栧垎椤垫暟灏忎簬1", null); + } + int count = argsService.selectCount(name); + if (count == 0) { + return success(0, null); + } + List<ArgsEntity> rs = argsService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); + + return success(count, rs); + } catch (Exception ex) { + return fail(ex.getMessage(), null); + } + } + + @SysLog() @ApiOperation(value = "鏌ヨ鎵�鏈�") @GetMapping(value = "/selectAll") public ResponseMsg<List<ArgsEntity>> selectAll() { @@ -96,7 +121,7 @@ @SysLog() @ApiOperation(value = "娣诲姞鏁版嵁") @ApiImplicitParams({ - @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", paramType = "body") + @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "ArgsEntity", paramType = "body") }) @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") public ResponseMsg<Integer> insert(@RequestBody ArgsEntity entity) { @@ -112,7 +137,7 @@ @SysLog() @ApiOperation(value = "鎵归噺娣诲姞") @ApiImplicitParams({ - @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", paramType = "body") + @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "ArgsEntity", paramType = "body") }) @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") public ResponseMsg<Integer> inserts(@RequestBody List<ArgsEntity> list) { @@ -144,7 +169,7 @@ @SysLog() @ApiOperation(value = "鎵归噺鍒犻櫎") @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", example = "{1,2}") + @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", example = "1,2") }) @GetMapping(value = "/deletes") public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { @@ -164,7 +189,7 @@ @SysLog() @ApiOperation(value = "淇敼鏁版嵁") @ApiImplicitParams({ - @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", paramType = "body") + @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "ArgsEntity", paramType = "body") }) @ResponseBody @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") @@ -181,7 +206,7 @@ @SysLog() @ApiOperation(value = "鎵归噺淇敼") @ApiImplicitParams({ - @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", paramType = "body") + @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "ArgsEntity", paramType = "body") }) @ResponseBody @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") -- Gitblit v1.9.3