|
@@ -2,7 +2,7 @@ package cn.reghao.oss.store.controller;
|
|
|
|
|
|
|
|
import cn.reghao.jutil.web.ServletUtil;
|
|
import cn.reghao.jutil.web.ServletUtil;
|
|
|
import cn.reghao.oss.api.dto.ObjectChannel;
|
|
import cn.reghao.oss.api.dto.ObjectChannel;
|
|
|
-import cn.reghao.oss.api.dto.OssPayload;
|
|
|
|
|
|
|
+import cn.reghao.jutil.jdk.model.jwt.OssPayload;
|
|
|
import cn.reghao.oss.api.util.AuthContext;
|
|
import cn.reghao.oss.api.util.AuthContext;
|
|
|
import cn.reghao.oss.api.util.JwtUtil;
|
|
import cn.reghao.oss.api.util.JwtUtil;
|
|
|
import cn.reghao.oss.api.rest.UploadFilePart;
|
|
import cn.reghao.oss.api.rest.UploadFilePart;
|
|
@@ -12,8 +12,6 @@ import cn.reghao.oss.store.service.ConsoleServiceWrapper;
|
|
|
import cn.reghao.oss.store.service.ObjectMultipartUploadService;
|
|
import cn.reghao.oss.store.service.ObjectMultipartUploadService;
|
|
|
import cn.reghao.jutil.jdk.result.WebResult;
|
|
import cn.reghao.jutil.jdk.result.WebResult;
|
|
|
import com.github.benmanes.caffeine.cache.Cache;
|
|
import com.github.benmanes.caffeine.cache.Cache;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -22,10 +20,11 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 分片上传接口
|
|
|
|
|
+ *
|
|
|
* @author reghao
|
|
* @author reghao
|
|
|
* @date 2022-12-08 20:40:55
|
|
* @date 2022-12-08 20:40:55
|
|
|
*/
|
|
*/
|
|
|
-@Api(tags = "分片上传接口")
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
public class ObjectMultipartUploadController {
|
|
public class ObjectMultipartUploadController {
|
|
|
private final ObjectMultipartUploadService objectMultipartUploadService;
|
|
private final ObjectMultipartUploadService objectMultipartUploadService;
|
|
@@ -39,7 +38,7 @@ public class ObjectMultipartUploadController {
|
|
|
this.cache = cache;
|
|
this.cache = cache;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @ApiOperation(value = "获取已上传的对象分片")
|
|
|
|
|
|
|
+ // 获取已上传的对象分片
|
|
|
@GetMapping(value = "/", params = {"multiparts"}, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@GetMapping(value = "/", params = {"multiparts"}, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResponseEntity<String> getUploadedPart(UploadFilePart uploadFilePart) throws Exception {
|
|
public ResponseEntity<String> getUploadedPart(UploadFilePart uploadFilePart) throws Exception {
|
|
|
int channelCode = uploadFilePart.getChannelCode();
|
|
int channelCode = uploadFilePart.getChannelCode();
|
|
@@ -77,7 +76,7 @@ public class ObjectMultipartUploadController {
|
|
|
return ResponseEntity.status(HttpStatus.OK).body(WebResult.success(uploadedPart));
|
|
return ResponseEntity.status(HttpStatus.OK).body(WebResult.success(uploadedPart));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @ApiOperation(value = "上传对象分片")
|
|
|
|
|
|
|
+ // 上传对象分片
|
|
|
@PostMapping(value = "/", params = {"multiparts"}, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
@PostMapping(value = "/", params = {"multiparts"}, produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public ResponseEntity<String> uploadPart(MultipartFile file, @Validated UploadFilePart uploadFilePart) throws Exception {
|
|
public ResponseEntity<String> uploadPart(MultipartFile file, @Validated UploadFilePart uploadFilePart) throws Exception {
|
|
|
int channelCode = uploadFilePart.getChannelCode();
|
|
int channelCode = uploadFilePart.getChannelCode();
|