| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.EditFileParam; |
| | | import com.sandu.ximon.admin.param.PlatformFilePermissionParam; |
| | | import com.sandu.ximon.admin.service.PlatformFileService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * @author LiuHaoNan |
| | | * @date 2022/9/14 |
| | | * 平尿件 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/v1/platformFile") |
| | | public class PlatformFileController { |
| | | |
| | | private final PlatformFileService platformFileService; |
| | | |
| | | /** |
| | | * 平尿件å表 |
| | | * |
| | | * @param baseConditionVO |
| | | * @param keyword |
| | | * @return |
| | | */ |
| | | @GetMapping("/listFile") |
| | | public ResponseVO<Object> listFile(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | return ResponseUtil.success(platformFileService.fileList(baseConditionVO, keyword)); |
| | | } |
| | | |
| | | /** |
| | | * æä»¶ä¸ä¼ |
| | | * |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @PostMapping("/addProgramFile") |
| | | public ResponseVO<Object> addProgramFile(@RequestParam("file") MultipartFile file) { |
| | | return ResponseUtil.success(platformFileService.addProgramFile(file)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æä»¶åç§° |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateFileName") |
| | | public ResponseVO<Object> updateFileName(@RequestBody EditFileParam param) { |
| | | return ResponseUtil.success(platformFileService.updateFileName(param)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿件 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @PostMapping("/deleteFile") |
| | | public ResponseVO<Object> deleteFile(@RequestBody EditFileParam param) { |
| | | return ResponseUtil.success(platformFileService.deleteFile(param)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½æä»¶ |
| | | * |
| | | * @param fileId |
| | | * @return |
| | | */ |
| | | @GetMapping("/downFile") |
| | | public ResponseVO<Object> downFile(@RequestParam("fileId") Long fileId) { |
| | | return ResponseUtil.success(platformFileService.downFile(fileId)); |
| | | } |
| | | |
| | | /** |
| | | * 设置æä»¶æµè§æé |
| | | * @param platformFilePermissionParam |
| | | * @return |
| | | */ |
| | | @PostMapping("/setPermission") |
| | | public ResponseVO<Object> downFile(@RequestBody PlatformFilePermissionParam platformFilePermissionParam) { |
| | | return ResponseUtil.success(platformFileService.setPermission(platformFilePermissionParam)); |
| | | } |
| | | |
| | | } |