-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: OCR 영수증 텍스트를 파싱한다 #16
base: inpink/#5
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다! 🥳🥳
) | ||
|
||
if (parsedOcr.parsed.isEmpty()) { | ||
throw ResponseStatusException(HttpStatus.BAD_REQUEST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IllegalArgumentException을 던지고, ExceptionHandler에서 http status code를 정의하는건 어떨까요?
app layer에서 어떻게 통신했는지 (ex. 컨슈머인지, HTTP인지) 알 필요가 없다고 생각합니다.
return parsedOcr | ||
} catch (e: Exception) { | ||
logger.error("Failed to parse ocr text.", e) | ||
throw ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
500 코드같은 경우는 IllegalStateException을 던지고 ExceptionHandler에서 잡을 수 있을것 같아요.
.baseUrl(chatbotUrl) | ||
.defaultHeaders { headers -> | ||
headers.add(HttpHeaders.AUTHORIZATION, "Bearer $authorization") | ||
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACCEPT를 명시하지않으면 기본으로 application/json으로 오나요??
@@ -63,6 +73,27 @@ class CreateReviewFacade( | |||
} | |||
} | |||
|
|||
fun parseOcrText(deviceId: String, ocrText: OcrTextRequest): ParsedOcrResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseOcrText 메소드는 CreateReviewFacade 객체보다 다른 객체에 있는게 자연스러울 것 같습니다!
요약
어떻게 구현했는지
다음 계획
이슈번호
close #15