Feat/#38 mock jobposting with data#97
Conversation
|
Warning Review limit reached
More reviews will be available in 47 minutes and 43 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughIntroduces ChangesJPA Auditing Infrastructure and Entity Migration
Corpus XLSX Upload Endpoint
Sequence Diagram(s)sequenceDiagram
participant Client
participant CorpusAdminController
participant CorpusImportService
Client->>CorpusAdminController: POST /api/admin/corpus/import/upload (MultipartFile)
CorpusAdminController->>CorpusAdminController: validateUploadFile(.xlsx check)
CorpusAdminController->>CorpusImportService: importFromXlsx(InputStream)
CorpusImportService->>CorpusImportService: new XSSFWorkbook(inputStream)
CorpusImportService->>CorpusImportService: importWorkbook(workbook)
CorpusImportService-->>CorpusAdminController: CorpusImportResult
CorpusAdminController-->>Client: ApiResponse<CorpusImportResult>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/com/jobdri/jobdri_api/domain/corpus/controller/CorpusAdminController.java`:
- Around line 56-63: The importCorpusByUpload method throws IOException which is
not handled by the global exception handler for invalid input, causing it to
return a 500 error instead of the appropriate 400 INVALID_PARAMETER error. Wrap
the corpusImportService.importFromXlsx(file.getInputStream()) call in a
try-catch block to catch IOException and convert it to GeneralException with
GeneralErrorCode.INVALID_PARAMETER and the message "파일 형식이 올바르지 않습니다.", then
remove throws IOException from the method signature so the wrapped exception
handling manages all error cases.
In
`@src/main/java/com/jobdri/jobdri_api/domain/corpus/service/CorpusImportService.java`:
- Around line 51-54: The importFromXlsx method accepts an InputStream parameter
that is not being closed, which can cause resource leaks when callers pass in
streams they've opened. Add the inputStream parameter to the try-with-resources
block in the importFromXlsx method (line 51-52) so it is automatically closed
when the method exits. Modify the try statement to manage both the inputStream
and the Workbook as resources, ensuring proper cleanup of all opened resources
regardless of whether the method exits normally or via an exception.
In `@src/main/java/com/jobdri/jobdri_api/global/entity/BaseEntity.java`:
- Around line 18-24: The BaseEntity class now enforces NOT NULL constraints on
createdAt and updatedAt columns, which will cause schema migration failures for
existing production tables that inherit from BaseEntity if those rows lack
values for updatedAt. Before deploying this change, identify all 13 tables
inheriting from BaseEntity and verify whether they already exist in production.
For any existing tables, create an explicit database migration that adds a
DEFAULT CURRENT_TIMESTAMP to the updated_at column before the NOT NULL
constraint is applied via Hibernate ddl-auto, or temporarily remove the
nullable=false constraint from the updatedAt field in BaseEntity until the
migration is safely deployed. Additionally, ensure schema.sql is updated to
reflect these column definitions with appropriate defaults for all newly created
tables.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1a56f74e-3fe1-4c3b-9d59-aaeb03741f59
📒 Files selected for processing (22)
src/main/java/com/jobdri/jobdri_api/domain/analysis/entity/Analysis.javasrc/main/java/com/jobdri/jobdri_api/domain/analysis/entity/CustomQuestionCandidate.javasrc/main/java/com/jobdri/jobdri_api/domain/analysis/entity/Question.javasrc/main/java/com/jobdri/jobdri_api/domain/analysis/entity/QuestionAnalysis.javasrc/main/java/com/jobdri/jobdri_api/domain/audit/entity/AuditLog.javasrc/main/java/com/jobdri/jobdri_api/domain/company/entity/Company.javasrc/main/java/com/jobdri/jobdri_api/domain/corpus/controller/CorpusAdminController.javasrc/main/java/com/jobdri/jobdri_api/domain/corpus/entity/CorpusClassificationMapping.javasrc/main/java/com/jobdri/jobdri_api/domain/corpus/entity/MockJobPostingCorpus.javasrc/main/java/com/jobdri/jobdri_api/domain/corpus/entity/MockQuestionCorpus.javasrc/main/java/com/jobdri/jobdri_api/domain/corpus/service/CorpusImportService.javasrc/main/java/com/jobdri/jobdri_api/domain/experience/entity/Experience.javasrc/main/java/com/jobdri/jobdri_api/domain/jobposting/entity/JobPosting.javasrc/main/java/com/jobdri/jobdri_api/domain/jobposting/entity/MockQuestionCache.javasrc/main/java/com/jobdri/jobdri_api/domain/mockapply/entity/MockApply.javasrc/main/java/com/jobdri/jobdri_api/domain/mockapply/entity/MockApplySequence.javasrc/main/java/com/jobdri/jobdri_api/domain/payment/entity/CreditTransaction.javasrc/main/java/com/jobdri/jobdri_api/domain/payment/entity/Payment.javasrc/main/java/com/jobdri/jobdri_api/domain/user/entity/User.javasrc/main/java/com/jobdri/jobdri_api/global/config/JpaAuditingConfig.javasrc/main/java/com/jobdri/jobdri_api/global/entity/BaseEntity.javasrc/main/java/com/jobdri/jobdri_api/global/entity/CreatedAtEntity.java
✨ 어떤 이유로 PR를 하셨나요?
📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요
작업 내용
관리자용 corpus 엑셀 적재 API에 파일 업로드 방식을 추가했습니다.
기존 경로 입력 방식은 유지하면서,
multipart/form-data로.xlsx파일을 직접 업로드해 적재할 수 있도록 확장했습니다.업로드 파일이 비어 있거나
.xlsx형식이 아닐 경우 예외 처리되도록 검증을 추가했습니다.엔티티 공통 생성일자/수정일자 관리를 위해
BaseEntity/CreatedAtEntity를 추가했습니다.JPA Auditing 설정을 적용해 수동
createdAt설정 로직을 공통화했습니다.User,Analysis,Question,QuestionAnalysis,MockApply,JobPosting,Payment등 주요 엔티티에 공통 시간 필드를 반영했습니다.AuditLog,CreditTransaction,CustomQuestionCandidate,CorpusClassificationMapping등은 성격에 맞게createdAt중심으로 정리했습니다.📸 작업 화면 스크린샷
🚨 관련 이슈 번호 [ ]
Summary by CodeRabbit
New Features
Refactor