-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Recruitment): 현재 모집중인 모집공고 목록 조회 기능 구현
- Loading branch information
1 parent
29deb03
commit 691c0e5
Showing
9 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...lab/api/domain/hiring/recruitment/adapter/in/web/OpenRecruitmentsRetrievalController.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,28 @@ | ||
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 java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import page.clab.api.domain.hiring.recruitment.application.dto.response.RecruitmentOpenResponseDto; | ||
import page.clab.api.domain.hiring.recruitment.application.port.in.RetrieveOpenRecruitmentsUseCase; | ||
import page.clab.api.global.common.dto.ApiResponse; | ||
|
||
@RestController | ||
@RequestMapping("/api/v1/recruitments") | ||
@RequiredArgsConstructor | ||
@Tag(name = "Hiring - Recruitment", description = "모집 공고") | ||
public class OpenRecruitmentsRetrievalController { | ||
|
||
private final RetrieveOpenRecruitmentsUseCase retrieveOpenRecruitmentsUseCase; | ||
|
||
@Operation(summary = "현재 모집 중인 모집 공고 목록", description = "ROLE_ANONYMOUS 이상의 권한이 필요함") | ||
@GetMapping("/open") | ||
public ApiResponse<List<RecruitmentOpenResponseDto>> retrieveRecruitmentsByEndDate() { | ||
List<RecruitmentOpenResponseDto> recruitments = retrieveOpenRecruitmentsUseCase.retrieveOpenRecruitments(); | ||
return ApiResponse.success(recruitments); | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...ab/api/domain/hiring/recruitment/application/dto/response/RecruitmentOpenResponseDto.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,13 @@ | ||
package page.clab.api.domain.hiring.recruitment.application.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import page.clab.api.domain.hiring.application.domain.ApplicationType; | ||
|
||
@Getter | ||
@Builder | ||
public class RecruitmentOpenResponseDto { | ||
|
||
private Long id; | ||
private ApplicationType applicationType; | ||
} |
8 changes: 8 additions & 0 deletions
8
...ab/api/domain/hiring/recruitment/application/port/in/RetrieveOpenRecruitmentsUseCase.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,8 @@ | ||
package page.clab.api.domain.hiring.recruitment.application.port.in; | ||
|
||
import java.util.List; | ||
import page.clab.api.domain.hiring.recruitment.application.dto.response.RecruitmentOpenResponseDto; | ||
|
||
public interface RetrieveOpenRecruitmentsUseCase { | ||
List<RecruitmentOpenResponseDto> retrieveOpenRecruitments(); | ||
} |
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
27 changes: 27 additions & 0 deletions
27
...b/api/domain/hiring/recruitment/application/service/OpenRecruitmentsRetrievalService.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,27 @@ | ||
package page.clab.api.domain.hiring.recruitment.application.service; | ||
|
||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import page.clab.api.domain.hiring.recruitment.application.dto.mapper.RecruitmentDtoMapper; | ||
import page.clab.api.domain.hiring.recruitment.application.dto.response.RecruitmentOpenResponseDto; | ||
import page.clab.api.domain.hiring.recruitment.application.port.in.RetrieveOpenRecruitmentsUseCase; | ||
import page.clab.api.domain.hiring.recruitment.application.port.out.RetrieveRecruitmentPort; | ||
import page.clab.api.domain.hiring.recruitment.domain.RecruitmentStatus; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class OpenRecruitmentsRetrievalService implements RetrieveOpenRecruitmentsUseCase { | ||
|
||
private final RetrieveRecruitmentPort retrieveRecruitmentPort; | ||
private final RecruitmentDtoMapper mapper; | ||
|
||
@Transactional(readOnly = true) | ||
@Override | ||
public List<RecruitmentOpenResponseDto> retrieveOpenRecruitments() { | ||
return retrieveRecruitmentPort.findByStatus(RecruitmentStatus.OPEN).stream() | ||
.map(mapper::toOpenDto) | ||
.toList(); | ||
} | ||
} |
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