| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除多条数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "主键ID集合", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | @ApiImplicitParam(name = "DirEntity", value = "目录实体类", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "") |
| | | }) |
| | | @GetMapping(value = "/deleteDirs") |
| | | public ResponseMsg<Integer> deleteDirs(@RequestParam List<Integer> ids) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新多条数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "DirEntity", value = "主键ID集合", dataType = "DirEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateDirs", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateDirs(@RequestBody List<DirEntity> dirEntity) { |
| | | try { |
| | | int count = dirService.updateDirs(dirEntity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据ID查询数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Integer", paramType = "query", example = "1") |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "递归查询数据") |
| | | @GetMapping(value = "/selectDirRecursive") |
| | | public ResponseMsg<List<DirEntity>> selectDirRecursive() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirRecursive(); |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |