Conversation
📝 WalkthroughWalkthrough
Changes자기소개서 기본 정보 저장 API (API-009)
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
docs/status.md (1)
24-24: ⚡ Quick win현재 PR을 Related Issue/PR에 추가하세요.
REQ-004의
Related Issue/PR필드에 현재 PR 번호가 누락되어 있습니다. 이슈#32만있고 해당 구현 PR 링크가 없습니다.문서 업데이트 규칙("issue 또는 PR이 생성되면
Related Issue/PR에 번호나 링크를 기록한다")에 따라 현재 PR도 추가해야 합니다.📝 수정 제안
-| REQ-004 | 자기소개서 등록 step 저장 | In Progress | High | API-009, API-010, API-011 | [`#32`](https://github.com/Rewrite-Team/Rewrite-BE/issues/32) | `CoverLetterServiceTest`, `CoverLetterControllerTest`, `GlobalExceptionHandlerTest`, `./gradlew test`, `./gradlew check` | API-009 등록 step1 기본 정보 저장 계약 구현됨. API-010/API-011은 후속 slice 후보 기준으로 분리 진행 | +| REQ-004 | 자기소개서 등록 step 저장 | In Progress | High | API-009, API-010, API-011 | [`#32`](https://github.com/Rewrite-Team/Rewrite-BE/issues/32), [PR #<현재PR번호>](https://github.com/Rewrite-Team/Rewrite-BE/pull/<현재PR번호>) | `CoverLetterServiceTest`, `CoverLetterControllerTest`, `GlobalExceptionHandlerTest`, `./gradlew test`, `./gradlew check` | API-009 등록 step1 기본 정보 저장 계약 구현됨. API-010/API-011은 후속 slice 후보 기준으로 분리 진행 |🤖 Prompt for 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. In `@docs/status.md` at line 24, In the status table row for REQ-004 (자기소개서 등록 step 저장), add the current PR number to the Related Issue/PR column following the existing markdown link format. The field currently only contains the issue `#32` link, but according to the documentation update rules, both the related issue and the implementation PR number should be included. Add the PR link in the same format as the existing issue link to complete the Related Issue/PR documentation for REQ-004.src/main/java/com/daon/rewrite/coverletter/dto/SaveBasicInfoResponse.java (1)
18-18: 공통 상수로API_ZONE을 추출하세요.
API_ZONE = ZoneId.of("Asia/Seoul")상수가 4개 DTO에서 중복되고 있습니다:
CreateCoverLetterResponse.java:14SaveBasicInfoResponse.java:18DeleteCoverLetterResponse.java:12CoverLetterListItemResponse.java:18유지보수성을 위해
coverletter패키지 내 공통 상수 클래스 또는 유틸리티에서 한 번만 정의하고 참조하세요.🤖 Prompt for 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. In `@src/main/java/com/daon/rewrite/coverletter/dto/SaveBasicInfoResponse.java` at line 18, The API_ZONE constant is duplicated across four DTO classes (SaveBasicInfoResponse, CreateCoverLetterResponse, DeleteCoverLetterResponse, and CoverLetterListItemResponse) in the coverletter package. Create a new constants class in the coverletter package (such as CoverLetterConstants) and define the API_ZONE constant there once with the value ZoneId.of("Asia/Seoul"). Then remove the private static final API_ZONE field from all four DTO classes and replace any references to it with the qualified reference to the constants class.src/main/java/com/daon/rewrite/coverletter/service/CoverLetterService.java (1)
226-233: 중복된 URI 스킴 검증 로직 제거.
isAbsoluteUrl메서드의getScheme() != null && !uri.getScheme().isBlank()검증은 불필요합니다. Java URI 파서는 빈 스킴(://,://)을 허용하지 않고URISyntaxException을 발생시키며,URI.isAbsolute()호출 시점에서 이미 스킴이 존재함을 보장합니다. 따라서 다음과 같이 단순화할 수 있습니다:private boolean isAbsoluteUrl(String value) { try { return new URI(value).isAbsolute(); } catch (URISyntaxException e) { return false; } }🤖 Prompt for 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. In `@src/main/java/com/daon/rewrite/coverletter/service/CoverLetterService.java` around lines 226 - 233, The isAbsoluteUrl method contains redundant URI scheme validation checks that are unnecessary. Since the Java URI parser already throws URISyntaxException for invalid URIs with empty or missing schemes, and URI.isAbsolute() inherently guarantees the existence of a valid scheme, the additional checks for getScheme() != null and !uri.getScheme().isBlank() are duplicate validations. Simplify the isAbsoluteUrl method to directly return the result of new URI(value).isAbsolute() within the try block, removing the redundant scheme null and blank checks while keeping the URISyntaxException catch block to return false for invalid URIs.
🤖 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.
Nitpick comments:
In `@docs/status.md`:
- Line 24: In the status table row for REQ-004 (자기소개서 등록 step 저장), add the
current PR number to the Related Issue/PR column following the existing markdown
link format. The field currently only contains the issue `#32` link, but according
to the documentation update rules, both the related issue and the implementation
PR number should be included. Add the PR link in the same format as the existing
issue link to complete the Related Issue/PR documentation for REQ-004.
In `@src/main/java/com/daon/rewrite/coverletter/dto/SaveBasicInfoResponse.java`:
- Line 18: The API_ZONE constant is duplicated across four DTO classes
(SaveBasicInfoResponse, CreateCoverLetterResponse, DeleteCoverLetterResponse,
and CoverLetterListItemResponse) in the coverletter package. Create a new
constants class in the coverletter package (such as CoverLetterConstants) and
define the API_ZONE constant there once with the value ZoneId.of("Asia/Seoul").
Then remove the private static final API_ZONE field from all four DTO classes
and replace any references to it with the qualified reference to the constants
class.
In `@src/main/java/com/daon/rewrite/coverletter/service/CoverLetterService.java`:
- Around line 226-233: The isAbsoluteUrl method contains redundant URI scheme
validation checks that are unnecessary. Since the Java URI parser already throws
URISyntaxException for invalid URIs with empty or missing schemes, and
URI.isAbsolute() inherently guarantees the existence of a valid scheme, the
additional checks for getScheme() != null and !uri.getScheme().isBlank() are
duplicate validations. Simplify the isAbsoluteUrl method to directly return the
result of new URI(value).isAbsolute() within the try block, removing the
redundant scheme null and blank checks while keeping the URISyntaxException
catch block to return false for invalid URIs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f5d89613-753b-40a2-abe6-5e4dc25ce965
📒 Files selected for processing (13)
docs/api/README.mddocs/api/cover-letters.mddocs/status.mdsrc/main/java/com/daon/rewrite/coverletter/controller/CoverLetterController.javasrc/main/java/com/daon/rewrite/coverletter/dto/SaveBasicInfoRequest.javasrc/main/java/com/daon/rewrite/coverletter/dto/SaveBasicInfoResponse.javasrc/main/java/com/daon/rewrite/coverletter/service/CoverLetterService.javasrc/main/java/com/daon/rewrite/global/exception/BusinessException.javasrc/main/java/com/daon/rewrite/global/exception/ErrorCode.javasrc/main/java/com/daon/rewrite/global/exception/GlobalExceptionHandler.javasrc/test/java/com/daon/rewrite/coverletter/controller/CoverLetterControllerTest.javasrc/test/java/com/daon/rewrite/coverletter/service/CoverLetterServiceTest.javasrc/test/java/com/daon/rewrite/global/exception/GlobalExceptionHandlerTest.java
작업 내용
PUT /cover-letters/{coverLetterId}/basic-info자기소개서 등록 step1 기본 정보 저장 API를 구현했습니다.DRAFT자기소개서만 수정할 수 있도록 검증을 추가했습니다.title,companyName,positionTitle,jobPostingUrl을 trim 후 저장하고, blankjobPostingUrl은null로 저장합니다.VALIDATION_ERROR와 field별details를 반환하도록 공통 비즈니스 예외 details 처리를 확장했습니다.DRAFT가 아닌 자기소개서는COVER_LETTER_NOT_DRAFT로 응답하도록 에러 코드를 추가했습니다.스크린샷 (@PutMapping("/cover-letters/{coverLetterId}/basic-info") test)
1. 테스트 이전 초안만 작성된 cover Letter 가 db 에 저장된 모습
2. @PutMapping("/cover-letters/{coverLetterId}/basic-info" 테스트 실행
3. 테스트 이후 basic info 가 채워진 cover Letter 모습 확인
4. 최대 허용 길이 이상의 값을 넣고 api 요청 시 에러 응답 확인 @PutMapping("/cover-letters/{coverLetterId}/basic-info"
관련 이슈
문서 반영
docs/api/README.mddocs/api/cover-letters.mddocs/status.md확인 결과
./gradlew test./gradlew checkgit diff --checkSummary by CodeRabbit
새 기능
개선 사항
테스트