Skip to content

Commit

Permalink
fix : 2차 탐색 종료 시 단계 수색으로 전환
Browse files Browse the repository at this point in the history
fix : 2차 탐색 종료 시 단계 수색으로 전환
  • Loading branch information
begong313 authored May 19, 2024
2 parents c304545 + 8daf55c commit ce69dee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
}

0 comments on commit ce69dee

Please sign in to comment.