| | |
| | | package com.ard.web.controller.route; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ard.common.annotation.Log; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ard.route.domain.ArdRouteFolder; |
| | | import com.ard.route.domain.route.ArdRouteFolder; |
| | | import com.ard.route.service.IArdRouteFolderService; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Api(tags = "文件夹") |
| | | @RestController |
| | | @RequestMapping("/folder") |
| | | @RequestMapping("/route/folder") |
| | | public class ArdRouteFolderController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | @Log(title = "文件夹", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteFolder ardRouteFolder) { |
| | | ardRouteFolder.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteFolderService.insertArdRouteFolder(ardRouteFolder)); |
| | | } |
| | | |
| | |
| | | @Log(title = "文件夹", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteFolder ardRouteFolder) { |
| | | ardRouteFolder.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteFolderService.updateArdRouteFolder(ardRouteFolder)); |
| | | } |
| | | |
| | |
| | | @Log(title = "文件夹", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardRouteFolderService.deleteArdRouteFolderByIds(ids)); |
| | | try { |
| | | Map<String, Integer> result = ardRouteFolderService.deleteArdRouteFolderByIds(ids); |
| | | if (!result.isEmpty()) { |
| | | return AjaxResult.success("删除成功.文件夹删除" + result.get("folder") + "文件删除" + result.get("file")); |
| | | } else { |
| | | return AjaxResult.success("没有删除文件夹信息。"); |
| | | } |
| | | } catch(Exception e){ |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | } |