Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle GPT exception with null barcode #148

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ public Mono<VoucherSaveRequestDto> handleGptResponse(OCRDto ocrDto, String usern
System.out.println("GPT response");
System.out.println(voucherSaveRequestDto.getBrandName());
System.out.println(voucherSaveRequestDto.getProductName());

if (voucherSaveRequestDto.getBrandName() == "" || voucherSaveRequestDto.getProductName() == "") {
System.out.println(voucherSaveRequestDto.getBarcode());
System.out.println(voucherSaveRequestDto.getExpiresAt());
if (voucherSaveRequestDto.getBrandName() == "" || voucherSaveRequestDto.getProductName() == ""
|| voucherSaveRequestDto.getBarcode() == "" || voucherSaveRequestDto.getExpiresAt() == "") {
throw new GptResponseException("GPT 응답이 올바르지 않습니다.", StatusEnum.NOT_FOUND);
}
return Mono.just(voucherSaveRequestDto);
Expand Down