| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.ard.common.annotation.Log; |
| | | import com.ard.common.core.controller.BaseController; |
| | | import com.ard.common.core.domain.AjaxResult; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | 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.ArdRouteFile; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ard.route.domain.route.ArdRouteFile; |
| | | import com.ard.route.service.IArdRouteFileService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 文件Controller |
| | |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | @Api(tags = "文件") |
| | | //@Api(tags = "文件") |
| | | @RestController |
| | | @RequestMapping("/file") |
| | | @RequestMapping("/route/file") |
| | | public class ArdRouteFileController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | /** |
| | | * 查询文件列表 |
| | | */ |
| | | @ApiOperation("查询文件列表") |
| | | @PreAuthorize("@ss.hasPermi('route:file:list')") |
| | | //@ApiOperation("查询文件列表") |
| | | //@PreAuthorize("@ss.hasPermi('route:file:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdRouteFile ardRouteFile) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 导出文件列表 |
| | | */ |
| | | @ApiOperation("导出文件列表") |
| | | @PreAuthorize("@ss.hasPermi('route:file:export')") |
| | | //@ApiOperation("导出文件列表") |
| | | //@PreAuthorize("@ss.hasPermi('route:file:export')") |
| | | @Log(title = "文件", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ArdRouteFile ardRouteFile) { |
| | |
| | | /** |
| | | * 获取文件详细信息 |
| | | */ |
| | | @ApiOperation("获取文件详细信息") |
| | | @PreAuthorize("@ss.hasPermi('route:file:query')") |
| | | //@ApiOperation("获取文件详细信息") |
| | | //@PreAuthorize("@ss.hasPermi('route:file:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardRouteFileService.selectArdRouteFileById(id)); |
| | |
| | | /** |
| | | * 新增文件 |
| | | */ |
| | | @ApiOperation("新增文件") |
| | | @PreAuthorize("@ss.hasPermi('route:file:add')") |
| | | //@ApiOperation("新增文件") |
| | | //@PreAuthorize("@ss.hasPermi('route:file:add')") |
| | | @Log(title = "文件", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteFile ardRouteFile) { |
| | | //@PostMapping("/addFile/{folderId}") |
| | | @PostMapping("/addFile") |
| | | public AjaxResult add(@RequestPart("file") MultipartFile file) |
| | | //@PathVariable String folderId) |
| | | { |
| | | ArdRouteFile ardRouteFile = new ArdRouteFile(); |
| | | ardRouteFile.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteFileService.insertArdRouteFile(ardRouteFile)); |
| | | //ardRouteFile.setFolderId(folderId); |
| | | return toAjax(ardRouteFileService.insertArdRouteFile(ardRouteFile, file)); |
| | | } |
| | | |
| | | /** |
| | | * 修改文件 |
| | | */ |
| | | @ApiOperation("修改文件") |
| | | @PreAuthorize("@ss.hasPermi('route:file:edit')") |
| | | //@ApiOperation("修改文件") |
| | | //@PreAuthorize("@ss.hasPermi('route:file:edit')") |
| | | @Log(title = "文件", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteFile ardRouteFile) { |
| | |
| | | /** |
| | | * 删除文件 |
| | | */ |
| | | @ApiOperation("删除文件") |
| | | @PreAuthorize("@ss.hasPermi('route:file:remove')") |
| | | //@ApiOperation("删除文件") |
| | | //@PreAuthorize("@ss.hasPermi('route:file:remove')") |
| | | @Log(title = "文件", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |