From 775333d5bcf6096565f891501254e899eb5b4413 Mon Sep 17 00:00:00 2001 From: JongBin Noh <95959567+begong313@users.noreply.github.com> Date: Sun, 26 May 2024 22:13:08 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=20=EC=8A=A4=ED=83=AD=EB=8F=8C?= =?UTF-8?q?=EC=95=84=EA=B0=81=EB=8A=94=20=EB=B2=84=EA=B7=B8=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EC=95=8C=EA=B3=A0=EB=A6=AC=EC=A6=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95#279?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../capstone/server/repository/SearchHistoryRepository.java | 2 ++ .../main/java/com/capstone/server/service/DetectService.java | 3 +-- .../java/com/capstone/server/service/SearchHistoryService.java | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/capstone/server/repository/SearchHistoryRepository.java b/server/src/main/java/com/capstone/server/repository/SearchHistoryRepository.java index a09280717d..6ee3a21933 100644 --- a/server/src/main/java/com/capstone/server/repository/SearchHistoryRepository.java +++ b/server/src/main/java/com/capstone/server/repository/SearchHistoryRepository.java @@ -13,5 +13,7 @@ public interface SearchHistoryRepository extends JpaRepository new NoSuchElementException("Missing person not found with ID: " + id)); //해당 Id의 가장 최신 탐색기록을 가져와 요청 보낼 dto생성 - SearchHistoryEntity searchHistoryEntity = searchHistoryRepository.findFirstByMissingPeopleEntityIdAndStepOrderByCreatedAtAsc(id, Step.fromValue("first")); + SearchHistoryEntity searchHistoryEntity = searchHistoryRepository.findFirstByMissingPeopleEntityIdAndStepOrderByCreatedAtDesc(id, Step.fromValue("first")); //과정2 : ai server요청에 쓸 dto를생성합니다 FirstDetectionRequestDto firstDetectionRequestDto = FirstDetectionRequestDto.fromEntity(missingPeople, searchHistoryEntity); firstDetectionRequestDto.setCctvId(cctvService.findCCTVsNearbyLocationWithinDistance(searchHistoryEntity.getLongitude(), searchHistoryEntity.getLatitude(), searchHistoryEntity.getSearchRadius())); diff --git a/server/src/main/java/com/capstone/server/service/SearchHistoryService.java b/server/src/main/java/com/capstone/server/service/SearchHistoryService.java index d261695a44..2a61b9a2c6 100644 --- a/server/src/main/java/com/capstone/server/service/SearchHistoryService.java +++ b/server/src/main/java/com/capstone/server/service/SearchHistoryService.java @@ -84,8 +84,6 @@ public Long createSearchHistory(SearchRequestDto searchRequestDto, Long missingP SearchHistoryEntity searchHistoryEntity = searchRequestDto.toSearchHistoryEntity(); searchHistoryEntity.setMissingPeopleEntity(missingPeopleEntity); searchHistoryEntity.setStep(step); - //실종자 step을 First로 설정 - missingPeopleEntity.setStep(step); return searchHistoryRepository.save(searchHistoryEntity).getId(); }