Skip to content

#29 feat : Load Lecture Metadata (keyword, tags, pre_course) #31

Merged
gisu1102 merged 2 commits intomainfrom
develop
Sep 12, 2025
Merged

#29 feat : Load Lecture Metadata (keyword, tags, pre_course) #31
gisu1102 merged 2 commits intomainfrom
develop

Conversation

@gisu1102
Copy link
Contributor

@gisu1102 gisu1102 commented Sep 12, 2025

feat : Load Lecture Metadata (keyword, tags, pre_course)

  • 기존 수작업으로 DB 업로드하던 부분을 자동화 하였습니다.
  • 위 구현한 load_metadata.py 를 기반으로 쿼리파라미터로 keywords,tags, precourses, all 을 선택해 DB 업로드를 할 수 있도록 합니다.
  • 기존 코드를 최대한 이용하였으며 executeMetaLoader 만 재 구현 하였습니다.

Summary by CodeRabbit

  • New Features
    • 엑셀로 강의 메타데이터(키워드/태그/선수과목) 업로드 지원
    • 업로드 모드 선택(전체/키워드/태그/선수과목)
    • 업로드 결과 메시지 제공, 관리자/매니저 권한에서만 사용 가능
  • Bug Fixes
    • 업로드 과정의 오류 검증 및 실패 처리 강화로 안정성 향상
    • 메타데이터 반영 후 색인 갱신을 시도해 최신 정보 유지

@coderabbitai
Copy link

coderabbitai bot commented Sep 12, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

강의 메타데이터(키워드/태그/선수과목) 업로드 기능이 추가되었고, 이를 위한 컨트롤러 엔드포인트, 서비스 로직, MetaMode enum, 그리고 Keyword·LectureKeyword 엔티티가 도입되었습니다. 서비스는 파이썬 스크립트를 실행해 처리하며, 처리 후 색인을 재시도합니다. 기존 학기 업로드 흐름의 종료 코드 검증도 강화되었습니다.

Changes

Cohort / File(s) Summary
API: Lecture meta upload endpoint
src/main/java/.../lecture/controller/LectureUploadController.java
멀티파트 Excel 업로드용 POST /upload/meta 엔드포인트 추가(ADMIN/MANAGER). 파라미터 excelFile, mode(기본 ALL). 서비스 uploadLectureMeta 위임, 201 Created 응답. OpenAPI 메타 추가.
DTO: Mode 선택 열거형
src/main/java/.../lecture/dto/MetaMode.java
MetaMode enum 신설: ALL, KEYWORDS, TAGS, PRE_COURSES.
Entities: 메타 키워드 모델
src/main/java/.../lecture/entity/Keyword.java, src/main/java/.../lecture/entity/LectureKeyword.java
Keyword 엔티티 및 LectureKeyword 조인 엔티티 추가. Keyword (1) - (N) LectureKeyword, LectureKeywordLectureKeyword@ManyToOne LAZY 매핑.
Service: 메타 업로드 처리 및 종료 코드 검증 강화
src/main/java/.../lecture/service/LectureUploadService.java
uploadLectureMeta(MultipartFile, MetaMode) 추가: 파일 저장 → 파이썬 스크립트 실행 → 로그 수집 → 색인 재시도. executeMetaLoader 헬퍼로 모드별 플래그 전달. 기존 학기 업로드 흐름에 비정상 종료 코드 시 예외 처리 추가.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Admin as Admin/Manager
  participant API as LectureUploadController
  participant SVC as LectureUploadService
  participant FS as File Storage
  participant PY as Python Loader (load_metadata.py)
  participant IDX as LectureStartupIndexer

  rect rgba(230,240,255,0.5)
    Admin->>API: POST /upload/meta (excelFile, mode)
    API->>SVC: uploadLectureMeta(file, mode)
  end

  rect rgba(240,255,240,0.5)
    SVC->>FS: saveFile(file)
    SVC->>PY: executeMetaLoader(excelPath, mode)
    PY-->>SVC: exit code (0/!0), logs
    alt 성공 (exit=0)
      SVC->>IDX: lectureIndex()
      IDX-->>SVC: 완료 또는 경고
      SVC-->>API: 201 Created
      API-->>Admin: 업로드 완료 메시지
    else 실패 (exit!=0)
      SVC-->>API: 예외 전파
      API-->>Admin: 오류 응답
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • doma17
  • X1n9fU

Poem

퐁퐁, 엑셀 한 장에 씨앗을 싣고
깡총, 메타 모드 따라 길을 고르고
키워드, 태그, 선수꿈까지 모아
파이썬에게 속삭여 반짝 반짝
색인 바람 솔솔—수업 숲이 열려요
(_)/) ʕ•ᴥ•ʔ <(깡총!)
( •_•)つ📄

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 888835a and a2b941b.

📒 Files selected for processing (5)
  • src/main/java/inu/codin/codin/domain/lecture/controller/LectureUploadController.java (2 hunks)
  • src/main/java/inu/codin/codin/domain/lecture/dto/MetaMode.java (1 hunks)
  • src/main/java/inu/codin/codin/domain/lecture/entity/Keyword.java (1 hunks)
  • src/main/java/inu/codin/codin/domain/lecture/entity/LectureKeyword.java (1 hunks)
  • src/main/java/inu/codin/codin/domain/lecture/service/LectureUploadService.java (4 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gisu1102 gisu1102 merged commit ac7cfa1 into main Sep 12, 2025
1 check was pending
@coderabbitai coderabbitai bot requested review from X1n9fU and doma17 September 12, 2025 09:29
@coderabbitai coderabbitai bot added the enhancement New feature or request label Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant