|
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import com.llisoft.common.vo.ResponseVo;
|
|
import com.llisoft.service.file.service.OssService;
|
|
import com.llisoft.service.file.service.OssService;
|
|
import com.llisoft.service.file.vo.DownloadRequestVo;
|
|
import com.llisoft.service.file.vo.DownloadRequestVo;
|
|
import com.llisoft.service.file.vo.UploadRequestVo;
|
|
import com.llisoft.service.file.vo.UploadRequestVo;
|
|
@@ -27,14 +28,14 @@ public class FileController {
|
|
|
|
|
|
@ApiOperation(value="上传")
|
|
@ApiOperation(value="上传")
|
|
@PostMapping("/upload")
|
|
@PostMapping("/upload")
|
|
- public UploadResponseVo upload(@Valid @RequestBody UploadRequestVo vo) throws Exception{
|
|
|
|
- return ossService.upload(vo.getPrefix(), vo.getSuffix(), vo.isCdn());
|
|
|
|
|
|
+ public ResponseVo<UploadResponseVo> upload(@Valid @RequestBody UploadRequestVo vo) throws Exception{
|
|
|
|
+ return ResponseVo.success(ossService.upload(vo.getPrefix(), vo.getSuffix(), vo.isCdn()));
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value="下载")
|
|
@ApiOperation(value="下载")
|
|
@PostMapping("/download")
|
|
@PostMapping("/download")
|
|
- public String download(@Valid @RequestBody DownloadRequestVo vo) throws Exception{
|
|
|
|
- return ossService.download(vo.getKey());
|
|
|
|
|
|
+ public ResponseVo<String> download(@Valid @RequestBody DownloadRequestVo vo) throws Exception{
|
|
|
|
+ return ResponseVo.success(ossService.download(vo.getKey()));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|