-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: 모집공고 등록 API 수정 및 상세 조회 기능 추가 완료 #652
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4d7382e
refactor(Recruitment): 모집공고 엔티티 필드 추가
SongJaeHoonn 91cc384
refactor(RecruitmentRequestDto): 요청 정보 추가
SongJaeHoonn 75cf2c0
refactor(Messages): 검증 메시지 추가
SongJaeHoonn 5ce7b06
refactor(RecruitmentResponseDto): 응답 필드 추가
SongJaeHoonn 2c0b4e1
feat(RecruitmentDetailsRetrieve): 모집 공고 상세 조회 기능 구현
SongJaeHoonn 6d403cb
refactor(Recruitment): 모집 일정 칼럼 추가
SongJaeHoonn 070d21b
refactor(Recruitment): 모집 설명 칼럼명 변경
SongJaeHoonn f8d55c3
refactor(Recruitment): 칼럼명 변경
SongJaeHoonn 3dca38b
refactor(messages): 검증 메시지 알파벳 순서로 변경
SongJaeHoonn 7536762
refactor(messages): 메시지 오타 및 잘못된 부분 수정
SongJaeHoonn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...b/api/domain/hiring/recruitment/adapter/in/web/RecruitmentDetailsRetrievalController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package page.clab.api.domain.hiring.recruitment.adapter.in.web; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import page.clab.api.domain.hiring.recruitment.application.dto.response.RecruitmentDetailsResponseDto; | ||
import page.clab.api.domain.hiring.recruitment.application.port.in.RetrieveRecruitmentUseCase; | ||
import page.clab.api.global.common.dto.ApiResponse; | ||
|
||
@RestController | ||
@RequestMapping("/api/v1/recruitments") | ||
@RequiredArgsConstructor | ||
@Tag(name = "Hiring - Recruitment", description = "모집 공고") | ||
public class RecruitmentDetailsRetrievalController { | ||
|
||
private final RetrieveRecruitmentUseCase retrieveRecruitmentUseCase; | ||
|
||
@Operation(summary = "모집 공고 상세 조회", description = "ROLE_ANONYMOUS 이상의 권한이 필요함") | ||
@GetMapping("/{recruitmentId}") | ||
public ApiResponse<RecruitmentDetailsResponseDto> retrieveRecruitmentDetails( | ||
@PathVariable(name = "recruitmentId") Long recruitmentId | ||
) { | ||
RecruitmentDetailsResponseDto recruitment = retrieveRecruitmentUseCase.retrieveRecruitmentDetails(recruitmentId); | ||
return ApiResponse.success(recruitment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...api/domain/hiring/recruitment/application/dto/response/RecruitmentDetailsResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package page.clab.api.domain.hiring.recruitment.application.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import page.clab.api.domain.hiring.application.domain.ApplicationType; | ||
|
||
@Getter | ||
@Builder | ||
public class RecruitmentDetailsResponseDto { | ||
|
||
private Long id; | ||
private String title; | ||
private String teamIntroduction; | ||
private LocalDateTime startDate; | ||
private LocalDateTime endDate; | ||
private String processTimeline; | ||
private ApplicationType applicationType; | ||
private String jobDescription; | ||
private String target; | ||
private String status; | ||
private LocalDateTime updatedAt; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...ge/clab/api/domain/hiring/recruitment/application/port/in/RetrieveRecruitmentUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
package page.clab.api.domain.hiring.recruitment.application.port.in; | ||
|
||
|
||
import page.clab.api.domain.hiring.recruitment.domain.Recruitment; | ||
import page.clab.api.domain.hiring.recruitment.application.dto.response.RecruitmentDetailsResponseDto; | ||
|
||
public interface RetrieveRecruitmentUseCase { | ||
|
||
Recruitment getById(Long recruitmentId); | ||
RecruitmentDetailsResponseDto retrieveRecruitmentDetails(Long recruitmentId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recuritment 테이블의 칼럼이 추가되는 변경사항을 확인했어요.
이 변경사항에 대한 SQL문을 PR에 추가해주시면 좋을 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
프로젝트에서 hibernate의
ddl-auto
옵션이update
로 되어있어 칼럼 추가시에는 자동으로 감지되어 쿼리문을 적용해주는 것으로 알고 있습니다.칼럼의 타입이나 이름, 제약 조건이 변경된 것이 아닌 단순 추가이므로 쿼리를 따로 날리지 않아도 괜찮지 않을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다! DB가 컨테이너 상으로 관리되고 있어서 SQL 작성이 필요하다고 생각했었네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
나중에 작업 내용을 추적하기 위해 PR을 살펴봤을 때, 구조적인 변화를 쉽게 확인할 수 있도록 하기 위함이지 않을까 싶어요.
아래 내용은 해당 작업과는 무관하지만, 생각이 나서 제안드려요.
현재
ddl-auto
설정이update
로 되어 있는데, 일반적으로 프로덕션 환경에서는none
으로 설정하여 사용하는 경우가 많아요. 이는 데이터베이스 변경으로 인한 안정성 문제를 예방하기 위함이에요.다만,
ddl-auto
를none
으로 설정하면 애플리케이션 실행 시 데이터베이스 스키마가 자동으로 변경되지 않기 때문에 변경 사항을 수동으로 관리해야 해요. 그럼에도 이러한 방식은 아래와 같은 장점을 제공해요.Flyway
나Liquibase
와 같은 마이그레이션 도구를 사용하여 스키마 변경을 관리하고, 애플리케이션과 데이터베이스의 상태를 명확히 일치시켜요.저희도 애플리케이션에서 자동 업데이트 대신 수동으로 데이터베이스 스키마를 관리하는 방식을 도입하면 어떨까 싶어요. 이를 통해 변경 사항을 더 명확히 관리하고, 예기치 않은 데이터 손실이나 장애를 예방할 수 있을 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
새로 생긴 칼럼이
NOT NULL
이라 기존 데이터를 옮기는걸 생각 못했었는데, SQL문 추가해뒀습니다!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사실 운영 환경에서
update
사용의 위험성은 알고 있었고, 제가 합류했을 때에도 운영 환경에서update
를 사용함에 의문을 가지고 있었긴 했는데, 로컬 환경에서update
를 계속 사용하다보니 칼럼 추가에 대한 변경은 자동으로 해주는 것이 정말 편했어서 운영 환경에서도 똑같이 적용하면 되어 "편함" 때문에 계속 사용하고 있다고 생각했습니다.그러나 MAU가 큰 환경에서는 쿼리문 실수 한번으로 피해가 클 수 있기에,
none
을 사용하는 것이 맞다고 봅니다.함께 의논 후 적용했으면 합니다!