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

feat: mathpix api 호출 #13

Merged
merged 21 commits into from
Feb 16, 2024
Merged

feat: mathpix api 호출 #13

merged 21 commits into from
Feb 16, 2024

Conversation

gitchannn
Copy link
Contributor

@gitchannn gitchannn commented Feb 8, 2024

주요 변경사항

  • Mathpix API 호출하는 코드 추가
  • 2회의 호출 모두 구현함.

관련 이슈

closes #19

@gitchannn gitchannn self-assigned this Feb 14, 2024
@gitchannn gitchannn changed the title feat: pdf upload api 구현 feat: mathpix api 호출 Feb 15, 2024

public Long translate(final MultipartFile file) {
log.info("File: {}, Mathpix API 호출을 시작합니다.", file.getOriginalFilename());
final String pdfId = pdfProcessClient.requestPdfId(file);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mathpix api로 pdf 보내서 pdf id 받아오는 과정입니당

public Long translate(final MultipartFile file) {
log.info("File: {}, Mathpix API 호출을 시작합니다.", file.getOriginalFilename());
final String pdfId = pdfProcessClient.requestPdfId(file);
final Object ocr = pdfQueryClient.queryPdfBy(pdfId);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mathpix api로 위에서 받은 pdf id를 전송해서 실제 ocr 완료된 파일을 받아오는 과정입니당

import static org.springframework.http.MediaType.MULTIPART_FORM_DATA;

@Slf4j
@Profile("!test")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서는 실제 api를 호출하기 때문에 테스트에서는 모킹한 다른 객체를 사용하기 위해서
테스트에서는 이 객체 안쓴다고 한 것

@jun-brro jun-brro merged commit 7ad81d0 into main Feb 16, 2024
1 check passed
@jun-brro jun-brro deleted the feature/8-pdf-upload-api branch February 16, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: Mathpix API (OCR) 테스트용 모킹 객체 생성
2 participants