13693261870
7 天以前 b8d62de41ff7e1e0549061308aa11f68cf881ed9
se-system/src/main/java/com/terra/system/controller/data/DirController.java
@@ -8,12 +8,13 @@
import com.terra.system.helper.WebHelper;
import com.terra.system.service.data.DirService;
import com.terra.system.service.sys.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import javax.annotation.Resource;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -24,7 +25,7 @@
 * @author sws
 * @date   2022-09-22
 */
@Api(tags = "数据管理\\目录管理")
@Tag(name = "数据管理\\目录管理")
@RestController
@RequestMapping("/dir")
public class DirController extends BaseController {
@@ -35,9 +36,9 @@
    TokenService tokenService;
    @SysLog()
    @ApiOperation(value = "插入一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "DirEntity", paramType = "body", example = "")
    @Operation(summary = "插入一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类", example = "")
    })
    @PostMapping(value = "/insertDir", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertDir(@RequestBody DirEntity entity, HttpServletRequest req) {
@@ -56,9 +57,9 @@
    }
    @SysLog()
    @ApiOperation(value = "插入多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "DirEntity", paramType = "body", example = "")
    @Operation(summary = "插入多条")
    @Parameters({
            @Parameter(name = "list", description = "实体类集合", example = "")
    })
    @PostMapping(value = "/insertDirs", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertDirs(@RequestBody List<DirEntity> list, HttpServletRequest req) {
@@ -77,9 +78,9 @@
    }
    @SysLog()
    @ApiOperation(value = "删除一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "删除一条")
    @Parameters({
            @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/deleteDir")
    public ResponseMsg<Integer> deleteDir(int id) {
@@ -93,9 +94,9 @@
    }
    @SysLog()
    @ApiOperation(value = "删除多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "DirEntity", paramType = "body", example = "")
    @Operation(summary = "删除多条")
    @Parameters({
            @Parameter(name = "ids", description = "ID数组", example = "")
    })
    @GetMapping(value = "/deleteDirs")
    public ResponseMsg<Integer> deleteDirs(@RequestParam List<Integer> ids) {
@@ -113,9 +114,9 @@
    }
    @SysLog()
    @ApiOperation(value = "更新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "DictEntity", paramType = "body", example = "")
    @Operation(summary = "更新一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类", example = "")
    })
    @ResponseBody
    @PostMapping(value = "/updateDir", produces = "application/json; charset=UTF-8")
@@ -135,9 +136,9 @@
    }
    @SysLog()
    @ApiOperation(value = "更新多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "DirEntity", paramType = "body", example = "")
    @Operation(summary = "更新多条")
    @Parameters({
            @Parameter(name = "list", description = "实体类集合", example = "")
    })
    @ResponseBody
    @PostMapping(value = "/updateDirs", produces = "application/json; charset=UTF-8")
@@ -159,9 +160,9 @@
    }
    @SysLog()
    @ApiOperation(value = "根据ID查询数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "根据ID查询数据")
    @Parameters({
            @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectDir")
    public ResponseMsg<DirEntity> selectDir(int id) {
@@ -175,7 +176,7 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有数据")
    @Operation(summary = "查询所有数据")
    @GetMapping(value = "/selectDirAll")
    public ResponseMsg<List<DirEntity>> selectDirAll() {
        try {
@@ -187,9 +188,9 @@
    }
    @SysLog()
    @ApiOperation(value = "下载目录结构")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "目录ID", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "下载目录结构")
    @Parameters({
            @Parameter(name = "id", description = "目录ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/downloadDir")
    public void downloadDir(int id, HttpServletResponse res) {
@@ -211,9 +212,9 @@
    }
    @SysLog()
    @ApiOperation(value = "查询项目")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "西")
    @Operation(summary = "查询项目")
    @Parameters({
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = "西")
    })
    @GetMapping(value = "/selectProject")
    public ResponseMsg<List<DirEntity>> selectProject(String name) {
@@ -227,9 +228,9 @@
    }
    @SysLog()
    @ApiOperation(value = "递归查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pid", value = "父ID", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "递归查询")
    @Parameters({
            @Parameter(name = "pid", description = "父ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectByPid")
    public ResponseMsg<List<DirEntity>> selectByPid(int pid) {