Skip to content

Commit

Permalink
Merge pull request #19 from aws-cloud-clubs/feature/#18
Browse files Browse the repository at this point in the history
[Fix] : nGrinder 테스트시 문제가 발생하여 GET 요청 RequestBody를 RequestParam으로
  • Loading branch information
Yeon-chae authored Aug 1, 2024
2 parents 58463ed + ca100e8 commit 36eecdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "SEARCH_API", description = "해당 파일경로가 있는지 확인하기 위한 검색 API")
Expand All @@ -27,7 +29,7 @@ public class FileSearchController {
+ "파일 경로에 대한 입력을 하였을 경우 유사한 파일 경로에 대한 결과물을 제공합니다.")
@Parameter(name = "filePath", description = "파일 경로에 관한 정보를 입력. 입력하지 않으면 전체 파일 경로를 반환")
@GetMapping("/search")
public ResponseEntity<FileSearchResponseDto> searchFiles(@RequestBody(required = false) FileSearchRequestDto fileSearchRequestDto) {
public ResponseEntity<FileSearchResponseDto> searchFiles(@ModelAttribute FileSearchRequestDto fileSearchRequestDto) {
List<String> searchedFiles = dbService.searchFiles(fileSearchRequestDto);
return ResponseEntity.ok(new FileSearchResponseDto("파일 검색 성공", searchedFiles));
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/mdt/backend/dto/FileSearchRequestDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class FileSearchRequestDto {
private String fileName;
Expand Down

0 comments on commit 36eecdf

Please sign in to comment.