危化品全生命周期管理后端
kongzy
2024-08-22 0c73654f55844e34772732914af8cc1e247aab63
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.gkhy.hazmat.admin.controller.system;
 
import com.gkhy.hazmat.common.annotation.RepeatSubmit;
import com.gkhy.hazmat.common.api.CommonResult;
import com.gkhy.hazmat.system.domain.vo.UploadObjectVO;
import com.gkhy.hazmat.system.service.SysCommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
@Api(tags = "通用接口前端控制器")
@RestController
@RequestMapping("/system/common")
public class SysCommonController {
    @Autowired
    private SysCommonService commonService;
 
    @RepeatSubmit
    @ApiOperation(value = "上传图片/文件(存本地)")
    @PostMapping("/uploadFile")
    public CommonResult<UploadObjectVO> uploadFile(MultipartFile file){
        return CommonResult.success(commonService.uploadFile(file));
    }
 
 
    @ApiOperation(value = "删除图片(存本地)")
    @DeleteMapping("/removeFile")
    public CommonResult removeFile(@RequestParam(required = true) String path){
        return CommonResult.success(commonService.removeFile(path));
    }
 
 
//    @ApiOperation(value = "资源管理视频文件上传(不分片)")
//    @PostMapping("/uploadVideo")
//    public CommonResult uploadVideo(@RequestPart("file") MultipartFile file) throws Exception { ;
//        return CommonResult.success(commonService.uploadVideo2M3u8(file));
//    }
 
 
 
}