| | |
| | | import com.ard.route.service.IArdRouteFolderService; |
| | | |
| | | /** |
| | | * 文件夹Controller |
| | | * 分组Controller |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | @Api(tags = "文件夹") |
| | | @Api(tags = "分组管理") |
| | | @RestController |
| | | @RequestMapping("/route/folder") |
| | | public class ArdRouteFolderController extends BaseController { |
| | |
| | | private IArdRouteFolderService ardRouteFolderService; |
| | | |
| | | /** |
| | | * 查询文件夹列表 |
| | | * 查询分组列表 |
| | | */ |
| | | @ApiOperation("查询文件夹列表") |
| | | @ApiOperation("查询分组列表") |
| | | //@PreAuthorize("@ss.hasPermi('route:folder:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdRouteFolder ardRouteFolder) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导出文件夹列表 |
| | | * 导出分组列表 |
| | | */ |
| | | @ApiOperation("导出文件夹列表") |
| | | @ApiOperation("导出分组列表") |
| | | //@PreAuthorize("@ss.hasPermi('route:folder:export')") |
| | | @Log(title = "文件夹", businessType = BusinessType.EXPORT) |
| | | @Log(title = "分组", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ArdRouteFolder ardRouteFolder) { |
| | | List<ArdRouteFolder> list = ardRouteFolderService.selectArdRouteFolderList(ardRouteFolder); |
| | | ExcelUtil<ArdRouteFolder> util = new ExcelUtil<ArdRouteFolder>(ArdRouteFolder.class); |
| | | util.exportExcel(response, list, "文件夹数据"); |
| | | util.exportExcel(response, list, "分组数据"); |
| | | } |
| | | |
| | | /** |
| | | * 获取文件夹详细信息 |
| | | * 获取分组详细信息 |
| | | */ |
| | | @ApiOperation("获取文件夹详细信息") |
| | | @ApiOperation("获取分组详细信息") |
| | | //@PreAuthorize("@ss.hasPermi('route:folder:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增文件夹 |
| | | * 新增分组 |
| | | */ |
| | | @ApiOperation("新增文件夹") |
| | | @ApiOperation("新增分组") |
| | | //@PreAuthorize("@ss.hasPermi('route:folder:add')") |
| | | @Log(title = "文件夹", businessType = BusinessType.INSERT) |
| | | @Log(title = "分组", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteFolder ardRouteFolder) { |
| | | ardRouteFolder.setCreateBy(getUsername()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改文件夹 |
| | | * 修改分组 |
| | | */ |
| | | @ApiOperation("修改文件夹") |
| | | @ApiOperation("修改分组") |
| | | //@PreAuthorize("@ss.hasPermi('route:folder:edit')") |
| | | @Log(title = "文件夹", businessType = BusinessType.UPDATE) |
| | | @Log(title = "分组", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteFolder ardRouteFolder) { |
| | | ardRouteFolder.setUpdateBy(getUsername()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除文件夹 |
| | | * 删除分组 |
| | | */ |
| | | @ApiOperation("删除文件夹") |
| | | @ApiOperation("删除分组") |
| | | //@PreAuthorize("@ss.hasPermi('route:folder:remove')") |
| | | @Log(title = "文件夹", businessType = BusinessType.DELETE) |
| | | @Log(title = "分组", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | try { |
| | | Map<String, Integer> result = ardRouteFolderService.deleteArdRouteFolderByIds(ids); |
| | | if (!result.isEmpty()) { |
| | | return AjaxResult.success("删除成功.文件夹删除" + result.get("folder") + "文件删除" + result.get("file")); |
| | | return AjaxResult.success("删除成功.分组删除" + result.get("folder") + "文件删除" + result.get("file")); |
| | | } else { |
| | | return AjaxResult.success("没有删除文件夹信息。"); |
| | | return AjaxResult.success("没有删除分组信息。"); |
| | | } |
| | | } catch(Exception e){ |
| | | return AjaxResult.error(e.getMessage()); |