You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
머신러닝 추론을 위해서는 PNG, JPEG 형식의 파일 포맷이 필요하다.
이를 위해서 파일을 관리하기 위한 기능을 추가하자
Interface
importorg.springframework.core.io.Resource;
importorg.springframework.http.ResponseEntity;
importorg.springframework.web.bind.annotation.*;
importorg.springframework.web.multipart.MultipartFile;
importjava.util.List;
publicinterfaceStorageController {
/** * 해당 프로젝트가 저장한 파일들의 리스트를 전달한다. * @param projectId * @return */@GetMapping("/Storage/{projectId}")
publicResponseEntity<List<String>> listFiles(
@PathVariableStringprojectId);
/** * 파일을 서버에 저장하는 기능 * @param file MultipartFile 형식으로 전달받은 파일 * @param projectId 파일을 업로드한 프로젝트 ID * @return 성공이나 에러에 따른 적절한 메시지를 출력한다. 여기에 담긴 메시지는 프론트에서 출력될 예정 */@GetMapping("/Storage/{projectId}")
publicResponseEntity<String> uploadFile(
@RequestParam("file")MultipartFilefile,
@PathVariableStringprojectId);
/** * 파일을 다운로드 하는 기능 * @param projectId 파일을 업로드한 프로젝트 ID * @param filename 다운로드를 요청할 파일 이름 * @return 전달하고자 하는 데이터 */@PostMapping("/Storage/{projectId}/{filename}")
publicResponseEntity<Resource> serveFile(
@PathVariableStringprojectId,
@PathVariableStringfilename);
/** * 파일을 삭제하는 기능 * @param projectId 파일을 업로드한 프로젝트 ID * @param filename 다운로드를 요청할 파일 이름 * @return 성공이나 에러에 따른 적절한 메시지를 출력한다. 여기에 담긴 메시지는 프론트에서 출력될 예정 */@DeleteMapping("/Storage/{projectId}/{filename}")
publicResponseEntity<String> deleteFile(
@PathVariableStringprojectId,
@PathVariableStringfilename);
}
issue : #239
기능 추가 :
void uploadFile(String projectId, MultipartFile file);
void deleteAll(String projectId);
위 메서드를 지원하는 api를 구성 함.
API 상세 정보는 BackEnd API 명세서를 확인바랍니다.
…e) 생성
issue : #239
기능 추가 :
void deleteByFileName(String projectId, String fileName);
List<String> getFileList(String projectId);
void serveFile(String projectId, String fileName , HttpServletRequest request, HttpServletResponse response);
위 메서드를 지원하는 api를 구성 함.
API 상세 정보는 BackEnd API 명세서를 확인바랍니다.
Description
머신러닝 추론을 위해서는 PNG, JPEG 형식의 파일 포맷이 필요하다.
이를 위해서 파일을 관리하기 위한 기능을 추가하자
Interface
Reference
The text was updated successfully, but these errors were encountered: