Merge pull request '사용가능 용량 API 수정' (#104) from feat/training_260202 into develop
Reviewed-on: #104
This commit was merged in pull request #104.
This commit is contained in:
@@ -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.tags.Tag;
|
||||
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.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -208,8 +212,15 @@ public class DatasetApiController {
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/usable-bytes")
|
||||
public ApiResponseDto<DatasetStorage> getUsableBytes() {
|
||||
return ApiResponseDto.ok(datasetService.getUsableBytes());
|
||||
public ApiResponseDto<DatasetStorage> getUsableBytes() throws IOException {
|
||||
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파일 등록 합니다.")
|
||||
|
||||
Reference in New Issue
Block a user