Commit ecc6b626 by zhangxingmin

push

parent 9b48c583
...@@ -3,40 +3,37 @@ package com.yd.oss.feign.client; ...@@ -3,40 +3,37 @@ package com.yd.oss.feign.client;
import com.yd.common.result.Result; import com.yd.common.result.Result;
import com.yd.oss.feign.fallback.ApiChunkedUploadContextFeignFallbackFactory; import com.yd.oss.feign.fallback.ApiChunkedUploadContextFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.Map; import java.util.Map;
/** /**
* 分片上传上下文信息Feign客户端 * 分片上传上下文信息Feign客户端
*/ */
@FeignClient(name = "yd-oss-api",path = "/oss/api/chunkedUploadContext",fallbackFactory = ApiChunkedUploadContextFeignFallbackFactory.class) @FeignClient(name = "yd-oss-api", path = "/oss/api/chunkedUploadContext", fallbackFactory = ApiChunkedUploadContextFeignFallbackFactory.class)
public interface ApiChunkedUploadContextFeignClient { public interface ApiChunkedUploadContextFeignClient {
/** /**
* 上传单个分片 * 上传单个分片
* @param taskId
* @param chunkIndex
* @param chunk
* @param projectBizId
* @param source
* @return
*/ */
@PostMapping("/uploadChunk") @PostMapping(value = "/uploadChunk", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Result<Void> uploadChunk(@RequestParam(value = "taskId",required = false) String taskId, Result<Void> uploadChunk(
@RequestParam(value = "chunkIndex",required = false) Integer chunkIndex, @RequestPart("taskId") String taskId,
@RequestParam(value = "chunk",required = false) MultipartFile chunk, @RequestPart("chunkIndex") Integer chunkIndex,
@RequestParam(value = "projectBizId",required = false) String projectBizId, @RequestPart("chunk") MultipartFile chunk,
@RequestParam(value = "source",required = false) String source); @RequestPart("projectBizId") String projectBizId,
@RequestPart("source") String source
);
/** /**
* 完成分片上传(合并) * 完成分片上传(合并)
* @param taskId
* @param projectBizId
* @return
*/ */
@PostMapping("/finishChunks") @PostMapping("/finishChunks")
Result<Map<String, Object>> finishChunks(@RequestParam(value = "taskId",required = false) String taskId, Result<Map<String, Object>> finishChunks(
@RequestParam(value = "projectBizId",required = false) String projectBizId); @RequestParam("taskId") String taskId,
@RequestParam("projectBizId") String projectBizId
);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment