Skip to content

Conversation

@frombunny
Copy link
Member

@frombunny frombunny commented May 24, 2025

🔍 관련 이슈


✅ 작업 분류

  • 버그 수정
  • 신규 기능
  • 프로젝트 구조 변경
  • 코드 리팩토링
  • 기능 수정

✨ 작업 내용

  1. 문서 조언 및 문서 수정 API 개발
  2. 문서 작성 시 위치 보정

✅ 체크리스트

  • 코드가 컴파일 및 빌드됨
  • 모든 테스트가 통과함
  • 관련 문서가 업데이트됨
  • 코드 리뷰가 수행됨
  • 커밋 메시지를 확인함

Summary by CodeRabbit

  • 신규 기능

    • 문서 업로드, 수정, AI 기반 조언 제공 등 문서 관리 기능이 추가되었습니다.
    • 다양한 문서 유형에 대한 필드 분석 및 사용자 맞춤형 자동 입력 기능이 도입되었습니다.
    • 문서 이미지에서 텍스트를 수정하고 PDF로 변환하는 기능이 추가되었습니다.
  • 버그 수정

    • 필수 요청 파트 누락 시 명확한 에러 메시지가 반환되도록 예외 처리가 개선되었습니다.
  • UI/응답 변경

    • 문서 업로드, 수정, 조언 요청 등 새로운 API 엔드포인트가 추가되었습니다.
    • 문서 필드 분석 응답 형식이 개선되었습니다.
  • 기타

    • AI 및 Flask 연동 로직이 확장되어 문서 분석 및 조언 품질이 향상되었습니다.

@frombunny frombunny self-assigned this May 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 24, 2025

Walkthrough

이 변경사항은 문서 업로드, 수정, 조언 제공 등 문서 처리 기능을 대폭 확장합니다. Flask 및 OpenAI 연동을 통한 AI 기반 분석, S3 파일 입출력, PDF/이미지 변환, 필드 매핑 등 다양한 서비스와 DTO가 추가 및 리팩토링되었습니다. 기존 폼 분석 로직도 FlaskService로 이동했습니다.

Changes

파일/경로 요약 변경 내용 요약
build.gradle Jackson, Spring Boot Test 등 의존성 2종 추가
.../entity/Document.java 문서 수정 메서드 추가, 정적 팩토리 메서드 파라미터 변경
.../service/DocumentService.java,
.../service/DocumentServiceImpl.java,
.../web/controller/DocumentController.java
문서 업로드, 수정, 조언 제공 신규 메서드 및 엔드포인트 추가, 기존 로직 확장
.../web/dto/ GetAdviceReq, GetAdviceRes, ModifyDocumentReq, ModifyDocumentReqWrapper, UploadDocumentRes 등 신규 레코드 DTO 다수 추가
.../service/FormService.java,
.../service/FormServiceImpl.java
모델 결과 및 필드 추출 관련 메서드 삭제, 단순화
.../web/controller/FormController.java 폼 필드 분석 로직을 FlaskService로 이관, DTO 타입 변경
.../web/dto/GetModelRes.java 삭제됨(도메인), Flask DTO로 대체
.../exception/GlobalExceptionHandler.java 요청 파트 누락 예외 핸들러 추가
.../external/service/OpenAiService.java 문서 수정 분석용 OpenAI 프롬프트 및 메서드 추가, requestBody 생성 메서드 분리/리네이밍
.../external/service/PdfService.java 이미지 덮어쓰기(rewriteImg) 등 신규 메서드, 텍스트 위치 보정 등 기존 메서드 개선
.../global/flask/dto/ GetFieldForModifyRes, GetFieldForWriteRes, GetModelRes, GetModelResForModify 등 신규 레코드 DTO 추가 및 기존 DTO 패키지/이름 변경
.../global/flask/mapper/FieldLabelMapper.java 공통 맵핑 방향 반전, 일부 항목 삭제/수정
.../global/flask/mapper/FieldTargetMapper.java 필드-타겟 매핑용 신규 클래스 및 메서드 추가
.../global/flask/service/FlaskService.java 문서 작성/수정/필드 추출 등 AI 분석 전반을 담당하는 신규 메서드 대량 추가 및 기존 메서드 리팩토링

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DocumentController
    participant DocumentService
    participant FlaskService
    participant PdfService
    participant S3
    participant OpenAiService

    User->>DocumentController: POST /api/document (파일 업로드)
    DocumentController->>DocumentService: uploadDocument(user, file)
    DocumentService->>FlaskService: detectType(file, fileName)
    DocumentService->>S3: 파일 업로드
    DocumentService-->>DocumentController: UploadDocumentRes

    User->>DocumentController: PUT /api/document/{id} (수정)
    DocumentController->>DocumentService: rewriteDocument(user, id, req)
    DocumentService->>S3: 이미지 다운로드
    DocumentService->>FlaskService: getResFromModelForModify(file, fileName)
    DocumentService->>PdfService: rewriteImg(s3ImageUrl, fields)
    DocumentService->>S3: PDF 업로드
    DocumentService-->>DocumentController: WriteDocsRes

    User->>DocumentController: GET /api/document/{id}/advice
    DocumentController->>DocumentService: getAdvice(user, id)
    DocumentService->>S3: 이미지 다운로드
    DocumentService->>FlaskService: getResFromModelForModify(file, fileName)
    DocumentService->>OpenAiService: getModifyAnalyzeFromOpenAi(fields, docType)
    OpenAiService-->>DocumentService: JSON 조언 결과
    DocumentService-->>DocumentController: List<GetAdviceRes>
Loading

Poem

🐇
문서 업로드, 수정, 조언까지
토끼는 깡총, AI와 함께 달리지!
S3에 저장, Flask에 분석,
OpenAI 조언도 척척.
필드 매핑도 똑똑하게,
새로워진 서비스, 신나게!

(토끼의 기쁨을 담아)

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between f0639f9 and 44ef922.

📒 Files selected for processing (24)
  • build.gradle (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/entity/Document.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/service/DocumentService.java (2 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/service/DocumentServiceImpl.java (3 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/web/controller/DocumentController.java (2 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/web/dto/GetAdviceReq.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/web/dto/GetAdviceRes.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/web/dto/ModifyDocumentReq.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/web/dto/ModifyDocumentReqWrapper.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/document/web/dto/UploadDocumentRes.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/form/service/FormService.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/form/service/FormServiceImpl.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/form/web/controller/FormController.java (3 hunks)
  • src/main/java/Sprout_Squad/EyeOn/domain/form/web/dto/GetModelRes.java (0 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/exception/GlobalExceptionHandler.java (2 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/external/service/OpenAiService.java (2 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/external/service/PdfService.java (2 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/flask/dto/GetFieldForModifyRes.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/flask/dto/GetFieldForWriteRes.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/flask/dto/GetModelRes.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/flask/dto/GetModelResForModify.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/flask/mapper/FieldLabelMapper.java (2 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/flask/mapper/FieldTargetMapper.java (1 hunks)
  • src/main/java/Sprout_Squad/EyeOn/global/flask/service/FlaskService.java (1 hunks)
💤 Files with no reviewable changes (1)
  • src/main/java/Sprout_Squad/EyeOn/domain/form/web/dto/GetModelRes.java

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@frombunny frombunny merged commit 781d0ee into dev May 25, 2025
2 checks passed
@frombunny frombunny linked an issue May 25, 2025 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 문서 조언 및 수정 API 개발

2 participants