| | |
| | | package com.terra.system.controller.data; |
| | | |
| | | import com.terra.system.annotation.SysLog; |
| | | import com.terra.system.controller.all.BaseController; |
| | | import com.terra.system.entity.all.ResponseMsg; |
| | | import com.terra.common.controller.all.BaseController; |
| | | import com.terra.common.entity.all.ResponseMsg; |
| | | import com.terra.system.entity.data.DirEntity; |
| | | import com.terra.system.entity.sys.UserEntity; |
| | | 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; |
| | |
| | | * @author sws |
| | | * @date 2022-09-22 |
| | | */ |
| | | @Api(tags = "数据管理\\目录管理") |
| | | @Tag(name = "数据管理\\目录管理") |
| | | @RestController |
| | | @RequestMapping("/dir") |
| | | public class DirController extends BaseController { |
| | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | @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) { |
| | |
| | | } |
| | | |
| | | @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) { |
| | |
| | | } |
| | | |
| | | @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) { |
| | |
| | | } |
| | | |
| | | @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") |
| | |
| | | } |
| | | |
| | | @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") |
| | |
| | | } |
| | | |
| | | @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) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有数据") |
| | | @Operation(summary = "查询所有数据") |
| | | @GetMapping(value = "/selectDirAll") |
| | | public ResponseMsg<List<DirEntity>> selectDirAll() { |
| | | try { |
| | |
| | | } |
| | | |
| | | @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) { |
| | |
| | | } |
| | | |
| | | @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) { |
| | |
| | | } |
| | | |
| | | @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) { |