From 8daf55c3f5dde74d16963b531b40ec9a6c0f4bbe Mon Sep 17 00:00:00 2001 From: JongBin Noh <95959567+begong313@users.noreply.github.com> Date: Mon, 20 May 2024 03:33:40 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=202=EC=B0=A8=20=ED=83=90=EC=83=89=20?= =?UTF-8?q?=EC=A2=85=EB=A3=8C=20=EC=8B=9C=20=EB=8B=A8=EA=B3=84=20=EC=88=98?= =?UTF-8?q?=EC=83=89=EC=9C=BC=EB=A1=9C=20=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/capstone/server/service/DetectService.java | 6 ++++++ .../com/capstone/server/service/KafkaConsumerService.java | 1 + 2 files changed, 7 insertions(+) diff --git a/server/src/main/java/com/capstone/server/service/DetectService.java b/server/src/main/java/com/capstone/server/service/DetectService.java index 131605e56b..976da5ee34 100644 --- a/server/src/main/java/com/capstone/server/service/DetectService.java +++ b/server/src/main/java/com/capstone/server/service/DetectService.java @@ -111,8 +111,14 @@ public void postFirstDetectionResult(FirstDetectionDataDto firstDetectionDataDto } } + @Transactional public FirstDetectionDataDto callSecondDetectApi(Long id, BetweenRequestDto betweenRequestDto, Long searchId) { try { + MissingPeopleEntity missingPeople = missingPeopleRepository.findById(id) + .orElseThrow(() -> new NoSuchElementException("Missing person not found with ID: " + id)); + //과정 2 : 해당 실종자의 탐색단계 수정 => 따로 함수 빼야됨 + missingPeople.setStep(Step.valueOf("EXIT")); + missingPeopleRepository.save(missingPeople); //과정1 : ai server요청에 쓸 dto를 생성 SecondDetectionRequestDto secondDetectionRequestDto = new SecondDetectionRequestDto(); secondDetectionRequestDto.setTopK(20); diff --git a/server/src/main/java/com/capstone/server/service/KafkaConsumerService.java b/server/src/main/java/com/capstone/server/service/KafkaConsumerService.java index c0d453561b..f994a8ca2d 100644 --- a/server/src/main/java/com/capstone/server/service/KafkaConsumerService.java +++ b/server/src/main/java/com/capstone/server/service/KafkaConsumerService.java @@ -38,5 +38,6 @@ public void consumeStartCallFirstDetectionApi(Long id) { public void consumeStartCallSecondDetectionApi(KafkaDto kafkaDto) { FirstDetectionDataDto firstDetectionDataDto = detectService.callSecondDetectApi(kafkaDto.getId(), kafkaDto.getBetweenRequestDto(), kafkaDto.getSearchId()); detectService.postSecondDetectionResult(firstDetectionDataDto); + } } \ No newline at end of file