Skip to content

Commit

Permalink
Merge pull request #242 from kookmin-sw/feature/238
Browse files Browse the repository at this point in the history
fix : 버그수정 및 응답 변경
  • Loading branch information
ancy0 authored May 19, 2024
2 parents e425eba + a28b00c commit c54b7f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public ResponseEntity<?> getMapPosition(
@PathVariable Long id,
@RequestParam(required = false, value = "step") String s) {
Step step = Step.fromValue(s);
if (s.equals("between"))
if (step == Step.BETWEEN)
return ResponseEntity.ok().body(new SuccessResponse(betweenService.getSearchResultsByMissingPeopleId(id)));
return ResponseEntity.ok().body(new SuccessResponse(searchResultService.getSearchResultByHistoryId(id, step)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.stream.Collectors;

import static com.capstone.server.code.ErrorCode.DATA_INTEGRITY_VALIDATION_ERROR;
import static com.capstone.server.code.ErrorCode.NOT_FOUND;

@Service
public class SearchResultService {
Expand Down Expand Up @@ -132,7 +131,7 @@ private SearchResultResponse<? extends DetectionResultDto> makeResultResponse(Pa
public List<MapCCTV> getSearchResultByHistoryId(Long missingPeopleId, Step step) {
SearchHistoryEntity searchResultEntity = searchHistoryRepository.findFirstByMissingPeopleEntityIdAndStepOrderByCreatedAtAsc(missingPeopleId, step);
if (searchResultEntity == null) {
throw new CustomException(NOT_FOUND, "data not found", "data no exit");
return new ArrayList<>();
}
Long searchHistoryId = searchResultEntity.getId();
List<SearchResultEntity> searchResults = searchResultRepository.findAllBySearchHistoryEntityId(searchHistoryId);
Expand Down

0 comments on commit c54b7f2

Please sign in to comment.