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] 지원서 제목 수정 API #85

Merged
merged 4 commits into from
Sep 10, 2023

Conversation

Lightieey
Copy link
Member

📌 Related Issue

🧾 Describe your changes

지원서 제목 수정 API 기능 구현

📚 Etc

@@ -20,4 +25,10 @@ public ApiResponse<Object> createApplication() {

return ApiResponse.success(SuccessCode.APPLICATION_CREATE_SUCCESS, applicationId);
}

@PatchMapping("/{applicationId}")
public ApiResponse<Object> updateApplicationTitle(@RequestParam Long applicationId, @RequestBody UpdateApplicationTitleRequestDto requestDto) {
Copy link
Member

Choose a reason for hiding this comment

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

Dto 이름 domain 이름으로 시작되게 통일시켜주면 좋을 것 같아요! -> ApplicationTitleUpdateRequestDto

@PatchMapping("/{applicationId}")
public ApiResponse<Object> updateApplicationTitle(@RequestParam Long applicationId, @RequestBody UpdateApplicationTitleRequestDto requestDto) {
applicationService.updateApplicationTitle(applicationId, requestDto);
return ApiResponse.success(SuccessCode.APPLICATION_UPDATE_SUCCESS);
Copy link
Member

Choose a reason for hiding this comment

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

요거 successCode 이름도 title 업데이트로 명시시켜주는게 어떨까요?? 메모 업데이트도 있으니!

Application application = applicationRepository.findById(applicationId)
.orElseThrow(() -> new NotFoundException(ErrorCode.NO_ID));

application.setTitle(requestDto.getTitle());
Copy link
Member

Choose a reason for hiding this comment

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

setter를 쓰는 것보단 updateTitle 함수를 만들어서 업데이트시켜주는게 좋을 것 같습니다. 스프링부트에서 setter는 값을 생성하는 건지, 수정하는건지 의도를 알기가 어려워 지양하는게 좋다고 합니다!

@Lightieey Lightieey merged commit cf0f904 into develop Sep 10, 2023
1 check passed
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