管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2024-12-18 0c8cd957630d43aa71183d34ecb1faf60689f8a4
src/main/java/com/lf/server/controller/data/DirController.java
@@ -37,7 +37,7 @@
    @SysLog()
    @ApiOperation(value = "插入一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "")
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "DirEntity", paramType = "body", example = "")
    })
    @PostMapping(value = "/insertDir", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertDir(@RequestBody DirEntity entity, HttpServletRequest req) {
@@ -58,7 +58,7 @@
    @SysLog()
    @ApiOperation(value = "插入多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "")
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "DirEntity", paramType = "body", example = "")
    })
    @PostMapping(value = "/insertDirs", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertDirs(@RequestBody List<DirEntity> list, HttpServletRequest req) {
@@ -95,7 +95,7 @@
    @SysLog()
    @ApiOperation(value = "删除多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "")
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "DirEntity", paramType = "body", example = "")
    })
    @GetMapping(value = "/deleteDirs")
    public ResponseMsg<Integer> deleteDirs(@RequestParam List<Integer> ids) {
@@ -209,4 +209,36 @@
            log.error(ex.getMessage(), ex);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询项目")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "西")
    })
    @GetMapping(value = "/selectProject")
    public ResponseMsg<List<DirEntity>> selectProject(String name) {
        try {
            List<DirEntity> list = dirService.selectProject(name);
            return success(list);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "递归查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pid", value = "父ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPid")
    public ResponseMsg<List<DirEntity>> selectByPid(int pid) {
        try {
            List<DirEntity> list = dirService.selectByPid(pid);
            return success(list);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
}