| | |
| | | package com.lf.server.controller.data; |
| | | |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.service.data.DirService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 目录管理 |
| | | * @author sws |
| | | * @date 2022-09-22 |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("/dir") |
| | | public class DirController { |
| | | @Autowired |
| | | DirService dirService; |
| | | |
| | | @RequestMapping(value = "/insertDir", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer insertDir(DirEntity dirEntity) { |
| | | |
| | | return dirService.insertDir(dirEntity); |
| | | } |
| | | |
| | | @RequestMapping(value = "/insertDirs", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer insertDirs(@RequestBody List<DirEntity> dirEntity) { |
| | | |
| | | return dirService.insertDirs(dirEntity); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/deleteDir", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer deleteDir(int id) { |
| | | |
| | | return dirService.deleteDir(id); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/deleteDirs", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer deleteDirs(@RequestBody List<Integer> ids) { |
| | | |
| | | if (!ids.isEmpty()) { |
| | | |
| | | return dirService.deleteDirs(ids); |
| | | |
| | | } else { |
| | | |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/updateDir", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public Integer updateDir(DirEntity dirEntity) { |
| | | |
| | | return dirService.updateDir(dirEntity); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/selectDir", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") |
| | | public DirEntity selectDir(int id) { |
| | | return dirService.selectDir(id); |
| | | } |
| | | |
| | | @GetMapping(value = "/selectDirAll") |
| | | public List<DirEntity> selectDirAll() { |
| | | |
| | | return dirService.selectDirAll(); |
| | | } |
| | | |
| | | } |