업로드 관련 수정
This commit is contained in:
@@ -13,7 +13,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -106,33 +105,31 @@ public class ModelMngApiController {
|
||||
return ApiResponseDto.okObject(modelMngService.removeModel(UUID.fromString(uuid)));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "모델등록")
|
||||
@PostMapping
|
||||
public ApiResponseDto<ApiResponseDto.ResponseObj> ModelMgmt(
|
||||
@RequestBody @Valid ModelMngDto.AddReq addReq) {
|
||||
@RequestBody @Valid ModelMngDto.AddReq addReq) {
|
||||
|
||||
return ApiResponseDto.ok(modelMngService.insertModel(addReq));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "데이터셋 대용량 파일 분할 전송", description = "데이터셋 파일 대용량 파일을 청크 단위로 전송합니다.")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(responseCode = "200", description = "청크 업로드 성공", content = @Content),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "업로드 세션을 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
value = {
|
||||
@ApiResponse(responseCode = "200", description = "청크 업로드 성공", content = @Content),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "업로드 세션을 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping(value = "/file-chunk-upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public ApiResponseDto<UploadDto.UploadRes> fileChunkUpload(
|
||||
@RequestParam("uuid") UUID uuid,
|
||||
@RequestParam("fileName") String fileName,
|
||||
@RequestParam("fileSize") long fileSize,
|
||||
// @RequestParam("fileHash") String fileHash,
|
||||
@RequestParam("chunkIndex") Integer chunkIndex,
|
||||
@RequestParam("chunkTotalIndex") Integer chunkTotalIndex,
|
||||
@RequestPart("chunkFile") MultipartFile chunkFile) {
|
||||
@RequestParam("uuid") UUID uuid,
|
||||
@RequestParam("fileName") String fileName,
|
||||
@RequestParam("fileSize") long fileSize,
|
||||
// @RequestParam("fileHash") String fileHash,
|
||||
@RequestParam("chunkIndex") Integer chunkIndex,
|
||||
@RequestParam("chunkTotalIndex") Integer chunkTotalIndex,
|
||||
@RequestPart("chunkFile") MultipartFile chunkFile) {
|
||||
|
||||
String uploadDivi = "model";
|
||||
|
||||
@@ -147,7 +144,7 @@ public class ModelMngApiController {
|
||||
upAddReqDto.setFinalPath(modelDir);
|
||||
upAddReqDto.setTempPath(modelTmpDir);
|
||||
|
||||
System.out.println("uuid === "+ uuid);
|
||||
System.out.println("uuid === " + uuid);
|
||||
|
||||
return ApiResponseDto.ok(modelMngService.uploadChunkModelFile(upAddReqDto, chunkFile));
|
||||
}
|
||||
|
||||
@@ -125,9 +125,7 @@ public class ModelMngDto {
|
||||
private String fileName;
|
||||
private String memo;
|
||||
|
||||
@JsonIgnore
|
||||
private UUID uuid;
|
||||
|
||||
@JsonIgnore private UUID uuid;
|
||||
}
|
||||
|
||||
@Schema(name = "searchReq", description = "검색 요청")
|
||||
|
||||
@@ -59,7 +59,6 @@ public class ModelMngService {
|
||||
return new ApiResponseDto.ResponseObj(ApiResponseDto.ApiResponseCode.OK, "삭제되었습니다.");
|
||||
}
|
||||
|
||||
|
||||
public ApiResponseDto.ResponseObj insertModel(ModelMngDto.AddReq addReq) {
|
||||
UUID uuid = UUID.randomUUID();
|
||||
addReq.setUuid(uuid);
|
||||
@@ -67,12 +66,10 @@ public class ModelMngService {
|
||||
return new ApiResponseDto.ResponseObj(ApiResponseDto.ApiResponseCode.OK, "등록되었습니다.");
|
||||
}
|
||||
|
||||
public UploadDto.UploadRes uploadChunkModelFile(UploadDto.UploadAddReq upAddReqDto, MultipartFile chunkFile)
|
||||
{
|
||||
public UploadDto.UploadRes uploadChunkModelFile(
|
||||
UploadDto.UploadAddReq upAddReqDto, MultipartFile chunkFile) {
|
||||
UploadDto.UploadRes upRes = uploadService.uploadChunk(upAddReqDto, chunkFile);
|
||||
|
||||
return upRes;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user