diff --git a/springboot-web/src/main/java/com/tiesheng/core/controller/ToolController.java b/springboot-web/src/main/java/com/tiesheng/core/controller/ToolController.java index b4ad741..129671e 100644 --- a/springboot-web/src/main/java/com/tiesheng/core/controller/ToolController.java +++ b/springboot-web/src/main/java/com/tiesheng/core/controller/ToolController.java @@ -4,6 +4,9 @@ package com.tiesheng.core.controller; import cn.hutool.captcha.LineCaptcha; import cn.hutool.core.util.IdUtil; import com.tiesheng.annotation.token.TokenIgnore; +import com.tiesheng.core.pojos.dto.ChunkCheckDTO; +import com.tiesheng.core.pojos.dto.ChunkMergeDTO; +import com.tiesheng.core.pojos.dto.ChunkStartDTO; import com.tiesheng.core.pojos.dto.ImageCodeDTO; import com.tiesheng.core.pojos.vo.PicVerifyVo; import com.tiesheng.core.service.FileUploadService; @@ -68,8 +71,8 @@ public class ToolController { */ @TokenIgnore @PostMapping(value = "/file/chunk_start") - public ApiResp fileChunkStart(String fileExt) { - fileUploadService.chunkStart(fileExt); + public ApiResp fileChunkStart(@RequestBody ChunkStartDTO dto) { + fileUploadService.chunkStart(dto.getFileExt()); return ApiResp.respOK(""); } @@ -81,8 +84,8 @@ public class ToolController { */ @TokenIgnore @PostMapping("/file/chunk_check") - public ApiResp fileChunkCheck(String fileMd5, Integer chunk) { - boolean exist = fileUploadService.chunkCheck(fileMd5, chunk); + public ApiResp fileChunkCheck(@RequestBody ChunkCheckDTO dto) { + boolean exist = fileUploadService.chunkCheck(dto.getFileMd5(), dto.getChunk()); return ApiResp.respOK(exist); } @@ -108,8 +111,8 @@ public class ToolController { */ @TokenIgnore @PostMapping("/file/chunk_merge") - public ApiResp fileChunkMerge(String fileMd5, String fileExt) { - String path = fileUploadService.chunkMerge(fileMd5, fileExt); + public ApiResp fileChunkMerge(@RequestBody ChunkMergeDTO dto) { + String path = fileUploadService.chunkMerge(dto.getFileMd5(), dto.getFileExt()); return ApiResp.respOK(path); } diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkCheckDTO.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkCheckDTO.java new file mode 100644 index 0000000..993b412 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkCheckDTO.java @@ -0,0 +1,30 @@ +package com.tiesheng.core.pojos.dto; + +/** + * @author hao + */ +public class ChunkCheckDTO { + + private String fileMd5; + private Integer chunk; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getFileMd5() { + return fileMd5; + } + + public void setFileMd5(String fileMd5) { + this.fileMd5 = fileMd5; + } + + public Integer getChunk() { + return chunk; + } + + public void setChunk(Integer chunk) { + this.chunk = chunk; + } +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkMergeDTO.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkMergeDTO.java new file mode 100644 index 0000000..49cb32d --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkMergeDTO.java @@ -0,0 +1,30 @@ +package com.tiesheng.core.pojos.dto; + +/** + * @author hao + */ +public class ChunkMergeDTO { + + private String fileMd5; + private String fileExt; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getFileMd5() { + return fileMd5; + } + + public void setFileMd5(String fileMd5) { + this.fileMd5 = fileMd5; + } + + public String getFileExt() { + return fileExt; + } + + public void setFileExt(String fileExt) { + this.fileExt = fileExt; + } +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkStartDTO.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkStartDTO.java new file mode 100644 index 0000000..d99501f --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/ChunkStartDTO.java @@ -0,0 +1,21 @@ +package com.tiesheng.core.pojos.dto; + +/** + * @author hao + */ +public class ChunkStartDTO { + + private String fileExt; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getFileExt() { + return fileExt; + } + + public void setFileExt(String fileExt) { + this.fileExt = fileExt; + } +}