管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-09 546915fc4b7267c16b2384809b0ca4f43ca33f3e
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")