사용가능 용량 API 수정 #104
@@ -14,6 +14,10 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.FileStore;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -208,8 +212,15 @@ public class DatasetApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@GetMapping("/usable-bytes")
|
@GetMapping("/usable-bytes")
|
||||||
public ApiResponseDto<DatasetStorage> getUsableBytes() {
|
public ApiResponseDto<DatasetStorage> getUsableBytes() throws IOException {
|
||||||
return ApiResponseDto.ok(datasetService.getUsableBytes());
|
FileStore store = Files.getFileStore(Path.of("."));
|
||||||
|
|
||||||
|
long usable = store.getUsableSpace();
|
||||||
|
DatasetStorage storage = new DatasetStorage();
|
||||||
|
storage.setUsableBytes(String.valueOf(usable));
|
||||||
|
|
||||||
|
// datasetService.getUsableBytes();
|
||||||
|
return ApiResponseDto.ok(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "학습데이터 zip파일 등록", description = "학습데이터 zip파일 등록 합니다.")
|
@Operation(summary = "학습데이터 zip파일 등록", description = "학습데이터 zip파일 등록 합니다.")
|
||||||
|
|||||||
Reference in New Issue
Block a user