-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
gg-admin-repo/src/main/java/gg/admin/repo/recruit/RecruitmentAdminRepository.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,11 +1,17 @@ | ||
package gg.admin.repo.recruit; | ||
|
||
import java.util.Optional; | ||
|
||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
import gg.data.recruit.recruitment.Recruitment; | ||
|
||
public interface RecruitmentAdminRepository extends JpaRepository<Recruitment, Long> { | ||
Page<Recruitment> findAllByOrderByEndTimeDesc(Pageable pageable); | ||
|
||
@Query("SELECT r FROM Recruitment r WHERE r.id = :recruitId AND r.isDeleted = false") | ||
Optional<Recruitment> findNotDeletedRecruit(Long recruitId); | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...ruit-api/src/main/java/gg/recruit/api/admin/controller/response/CheckItemAdminResDto.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,17 @@ | ||
package gg.recruit.api.admin.controller.response; | ||
|
||
import gg.recruit.api.admin.service.result.CheckItemAdminSvcDto; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@Getter | ||
public class CheckItemAdminResDto { | ||
private Long id; | ||
private String contents; | ||
|
||
public CheckItemAdminResDto(CheckItemAdminSvcDto dto) { | ||
this.id = dto.getId(); | ||
this.contents = dto.getContents(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...uit-api/src/main/java/gg/recruit/api/admin/controller/response/FormDetailAdminResDto.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,26 @@ | ||
package gg.recruit.api.admin.controller.response; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import gg.data.recruit.recruitment.enums.InputType; | ||
import gg.recruit.api.admin.service.result.FormDetailAdminSvcDto; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@Getter | ||
public class FormDetailAdminResDto { | ||
private Long questionId; | ||
private String question; | ||
private InputType inputType; | ||
private List<CheckItemAdminResDto> checkList; | ||
|
||
public FormDetailAdminResDto(FormDetailAdminSvcDto dto) { | ||
this.questionId = dto.getQuestionId(); | ||
this.question = dto.getQuestion(); | ||
this.inputType = dto.getInputType(); | ||
this.checkList = dto.getCheckList().stream() | ||
.map(CheckItemAdminResDto::new).collect(Collectors.toList()); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
.../src/main/java/gg/recruit/api/admin/controller/response/RecruitmentAdminDetailResDto.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 gg.recruit.api.admin.controller.response; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import gg.recruit.api.admin.service.result.RecruitmentDetailAdminSvcDto; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class RecruitmentAdminDetailResDto { | ||
private LocalDateTime startDate; | ||
private LocalDateTime endDate; | ||
private String title; | ||
private String contents; | ||
private String generation; | ||
private List<FormDetailAdminResDto> forms; | ||
|
||
public RecruitmentAdminDetailResDto(RecruitmentDetailAdminSvcDto recruitmentDetail) { | ||
this.startDate = recruitmentDetail.getStartDate(); | ||
this.endDate = recruitmentDetail.getEndDate(); | ||
this.title = recruitmentDetail.getTitle(); | ||
this.contents = recruitmentDetail.getContents(); | ||
this.generation = recruitmentDetail.getGeneration(); | ||
this.forms = recruitmentDetail.getForms().stream() | ||
.map(FormDetailAdminResDto::new).collect(Collectors.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
15 changes: 15 additions & 0 deletions
15
gg-recruit-api/src/main/java/gg/recruit/api/admin/service/result/CheckItemAdminSvcDto.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,15 @@ | ||
package gg.recruit.api.admin.service.result; | ||
|
||
import gg.data.recruit.recruitment.CheckList; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class CheckItemAdminSvcDto { | ||
private Long id; | ||
private String contents; | ||
|
||
public CheckItemAdminSvcDto(CheckList checkList) { | ||
this.id = checkList.getId(); | ||
this.contents = checkList.getContent(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
gg-recruit-api/src/main/java/gg/recruit/api/admin/service/result/FormDetailAdminSvcDto.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,24 @@ | ||
package gg.recruit.api.admin.service.result; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import gg.data.recruit.recruitment.Question; | ||
import gg.data.recruit.recruitment.enums.InputType; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class FormDetailAdminSvcDto { | ||
private Long questionId; | ||
private String question; | ||
private InputType inputType; | ||
private List<CheckItemAdminSvcDto> checkList; | ||
|
||
public FormDetailAdminSvcDto(Question question) { | ||
this.questionId = question.getId(); | ||
this.question = question.getQuestion(); | ||
this.inputType = question.getInputType(); | ||
this.checkList = question.getCheckLists().stream() | ||
.map(CheckItemAdminSvcDto::new).collect(Collectors.toList()); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...t-api/src/main/java/gg/recruit/api/admin/service/result/RecruitmentDetailAdminSvcDto.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 gg.recruit.api.admin.service.result; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import gg.data.recruit.recruitment.Recruitment; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class RecruitmentDetailAdminSvcDto { | ||
private LocalDateTime startDate; | ||
private LocalDateTime endDate; | ||
private String title; | ||
private String contents; | ||
private String generation; | ||
private List<FormDetailAdminSvcDto> forms; | ||
|
||
public RecruitmentDetailAdminSvcDto(Recruitment recruit) { | ||
this.startDate = recruit.getStartTime(); | ||
this.endDate = recruit.getEndTime(); | ||
this.title = recruit.getTitle(); | ||
this.contents = recruit.getContents(); | ||
this.generation = recruit.getGeneration(); | ||
this.forms = recruit.getQuestions().stream() | ||
.map(FormDetailAdminSvcDto::new).collect(Collectors.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