From 21bc8edbdbd26b1bae8bde5bdb01d5cf79cab1ff Mon Sep 17 00:00:00 2001 From: Kangmin Date: Wed, 15 Nov 2023 23:13:50 +0900 Subject: [PATCH 01/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#449)=20jobcod?= =?UTF-8?q?e=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/RecruitAreaResponse.java | 2 ++ .../usecase/QueryMyRecruitmentUseCase.java | 22 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java index 22950688f..29b10e968 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java @@ -1,12 +1,14 @@ package team.retum.jobis.domain.recruitment.dto.response; import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; import java.util.List; @Getter @AllArgsConstructor +@Builder public class RecruitAreaResponse { private final Long id; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java index 04a426b14..f4d1d328c 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java @@ -3,6 +3,8 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.spi.SecurityPort; +import team.retum.jobis.domain.code.model.Code; +import team.retum.jobis.domain.code.spi.QueryCodePort; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; @@ -18,6 +20,7 @@ public class QueryMyRecruitmentUseCase { private final SecurityPort securityPort; private final QueryRecruitmentPort queryRecruitmentPort; + private final QueryCodePort queryCodePort; public QueryRecruitmentDetailResponse execute() { Long currentUserId = securityPort.getCurrentUserId(); @@ -25,10 +28,25 @@ public QueryRecruitmentDetailResponse execute() { Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(currentUserId) .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); List recruitAreaResponses = - queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()); + queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()) + .stream().map(recruitAreaResponse -> RecruitAreaResponse.builder() + .id(recruitAreaResponse.getId()) + .job(getJobKeywords(recruitAreaResponse.getJob())) + .tech(recruitAreaResponse.getTech()) + .hiring(recruitAreaResponse.getHiring()) + .majorTask(recruitAreaResponse.getMajorTask()) + .preferentialTreatment(recruitAreaResponse.getPreferentialTreatment()) + .build() + ).toList(); + return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); } + + private List getJobKeywords(List jobCodes) { + return queryCodePort.queryCodesByIdIn( + jobCodes.stream().map(Long::parseLong).toList() + ).stream().map(Code::getKeyword).toList(); + } } From fe27dd6543f9b2d8ac0dd2f5ec1d46f840d08f3e Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Thu, 16 Nov 2023 09:38:47 +0900 Subject: [PATCH 02/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#449)=20service=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/service/GetKeywordsService.java | 31 ++++++++++++++ .../dto/response/RecruitAreaResponse.java | 2 - .../service/GetRecruitmentDetailService.java | 41 +++++++++++++++++++ .../usecase/QueryMyRecruitmentUseCase.java | 37 ++--------------- .../QueryRecruitmentDetailUseCase.java | 33 +++------------ .../StudentQueryRecruitmentsUseCase.java | 17 ++------ .../TeacherQueryRecruitmentsUseCase.java | 17 ++------ 7 files changed, 86 insertions(+), 92 deletions(-) create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java new file mode 100644 index 000000000..5df3bd985 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java @@ -0,0 +1,31 @@ +package team.retum.jobis.domain.code.service; + +import lombok.RequiredArgsConstructor; +import team.retum.jobis.common.annotation.Service; +import team.retum.jobis.common.util.StringUtil; +import team.retum.jobis.domain.code.model.Code; +import team.retum.jobis.domain.code.spi.QueryCodePort; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class GetKeywordsService { + + private final QueryCodePort queryCodePort; + + public String getKeywordsAsList(String jobCodes) { + return StringUtil.joinStringList( + queryCodePort.queryCodesByIdIn( + StringUtil.divideString(jobCodes, ",").stream().map(Long::parseLong).toList() + ).stream().map(Code::getKeyword).toList(), + "/" + ); + } + + public List getKeywordsAsList(List jobCodes) { + return queryCodePort.queryCodesByIdIn( + jobCodes.stream().map(Long::parseLong).toList() + ).stream().map(Code::getKeyword).toList(); + } +} diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java index 29b10e968..e7d78e07f 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java @@ -1,13 +1,11 @@ package team.retum.jobis.domain.recruitment.dto.response; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import java.util.List; @Getter -@AllArgsConstructor @Builder public class RecruitAreaResponse { diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java new file mode 100644 index 000000000..d6a4fb452 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java @@ -0,0 +1,41 @@ +package team.retum.jobis.domain.recruitment.service; + +import lombok.RequiredArgsConstructor; +import team.retum.jobis.common.annotation.Service; +import team.retum.jobis.domain.code.service.GetKeywordsService; +import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; +import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; +import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; +import team.retum.jobis.domain.recruitment.model.Recruitment; +import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; +import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class GetRecruitmentDetailService { + + private final QueryRecruitmentPort queryRecruitmentPort; + private final GetKeywordsService getKeywordsService; + + public QueryRecruitmentDetailResponse execute(Long recruitId) { + + Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(recruitId) + .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); + + RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); + List recruitAreaResponses = queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()) + .stream().map(recruitAreaResponse -> RecruitAreaResponse.builder() + .id(recruitAreaResponse.getId()) + .job(getKeywordsService.getKeywordsAsList(recruitAreaResponse.getJob())) + .tech(recruitAreaResponse.getTech()) + .hiring(recruitAreaResponse.getHiring()) + .majorTask(recruitAreaResponse.getMajorTask()) + .preferentialTreatment(recruitAreaResponse.getPreferentialTreatment()) + .build() + ).toList(); + + return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); + } +} diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java index f4d1d328c..8fa4acc5a 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java @@ -3,50 +3,19 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.spi.SecurityPort; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; -import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; -import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; -import team.retum.jobis.domain.recruitment.model.Recruitment; -import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; -import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO; - -import java.util.List; +import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; @RequiredArgsConstructor @ReadOnlyUseCase public class QueryMyRecruitmentUseCase { private final SecurityPort securityPort; - private final QueryRecruitmentPort queryRecruitmentPort; - private final QueryCodePort queryCodePort; + private final GetRecruitmentDetailService getRecruitmentDetailService; public QueryRecruitmentDetailResponse execute() { Long currentUserId = securityPort.getCurrentUserId(); - Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(currentUserId) - .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - - RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); - List recruitAreaResponses = - queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()) - .stream().map(recruitAreaResponse -> RecruitAreaResponse.builder() - .id(recruitAreaResponse.getId()) - .job(getJobKeywords(recruitAreaResponse.getJob())) - .tech(recruitAreaResponse.getTech()) - .hiring(recruitAreaResponse.getHiring()) - .majorTask(recruitAreaResponse.getMajorTask()) - .preferentialTreatment(recruitAreaResponse.getPreferentialTreatment()) - .build() - ).toList(); - - return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); - } - - private List getJobKeywords(List jobCodes) { - return queryCodePort.queryCodesByIdIn( - jobCodes.stream().map(Long::parseLong).toList() - ).stream().map(Code::getKeyword).toList(); + return getRecruitmentDetailService.execute(currentUserId); } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java index 4049cf776..4b19b98ac 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java @@ -2,44 +2,21 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; +import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; -import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; -import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; -import team.retum.jobis.domain.recruitment.model.Recruitment; +import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; -import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO; - -import java.util.List; @RequiredArgsConstructor @ReadOnlyUseCase public class QueryRecruitmentDetailUseCase { private final QueryRecruitmentPort queryRecruitmentPort; - private final QueryCodePort queryCodePort; + private final GetKeywordsService getKeywordsService; + private final GetRecruitmentDetailService getRecruitmentDetailService; public QueryRecruitmentDetailResponse execute(Long recruitId) { - Recruitment recruitment = queryRecruitmentPort.queryRecruitmentById(recruitId) - .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - - RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); - List recruitAreaResponses = - queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()).stream() - .map(area -> - new RecruitAreaResponse( - area.getId(), - queryCodePort.queryCodesByIdIn(area.getJob().stream().map(Long::parseLong).toList()).stream() - .map(Code::getKeyword) - .toList(), - area.getTech(), - area.getHiring(), - area.getMajorTask(), - area.getPreferentialTreatment() - ) - ).toList(); - return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); + return getRecruitmentDetailService.execute(recruitId); } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java index 9ea09074b..cc7d0fe4d 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java @@ -5,9 +5,7 @@ import team.retum.jobis.common.dto.response.TotalPageCountResponse; import team.retum.jobis.common.spi.SecurityPort; import team.retum.jobis.common.util.NumberUtil; -import team.retum.jobis.common.util.StringUtil; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; +import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; import team.retum.jobis.domain.recruitment.dto.response.StudentQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.StudentQueryRecruitmentsResponse.StudentRecruitmentResponse; @@ -23,7 +21,7 @@ public class StudentQueryRecruitmentsUseCase { private final QueryRecruitmentPort queryRecruitmentPort; private final SecurityPort securityPort; - private final QueryCodePort queryCodePort; + private final GetKeywordsService getKeywordsService; public StudentQueryRecruitmentsResponse execute( String name, @@ -50,7 +48,7 @@ public StudentQueryRecruitmentsResponse execute( .recruitId(recruitment.getRecruitmentId()) .companyName(recruitment.getCompanyName()) .trainPay(recruitment.getTrainPay()) - .jobCodeList(getJobKeywords(recruitment.getJobCodes())) + .jobCodeList(getKeywordsService.getKeywordsAsList(recruitment.getJobCodes())) .military(recruitment.isMilitarySupport()) .companyProfileUrl(recruitment.getCompanyLogoUrl()) .totalHiring(recruitment.getTotalHiring()) @@ -80,13 +78,4 @@ public TotalPageCountResponse getTotalPageCount(String name, Long jobCode, List< return new TotalPageCountResponse(totalPageCount); } - - private String getJobKeywords(String jobCodes) { - return StringUtil.joinStringList( - queryCodePort.queryCodesByIdIn( - StringUtil.divideString(jobCodes, ",").stream().map(Long::parseLong).toList() - ).stream().map(Code::getKeyword).toList(), - "/" - ); - } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java index 74c639abf..704d51012 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java @@ -4,9 +4,7 @@ import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.dto.response.TotalPageCountResponse; import team.retum.jobis.common.util.NumberUtil; -import team.retum.jobis.common.util.StringUtil; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; +import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; import team.retum.jobis.domain.recruitment.dto.response.TeacherQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.TeacherQueryRecruitmentsResponse.TeacherRecruitmentResponse; @@ -21,7 +19,7 @@ public class TeacherQueryRecruitmentsUseCase { private final QueryRecruitmentPort queryRecruitmentPort; - private final QueryCodePort queryCodePort; + private final GetKeywordsService getKeywordsService; public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate start, LocalDate end, Integer year, RecruitStatus status, Long page) { @@ -49,7 +47,7 @@ public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate st .applicationRequestedCount(recruitment.getRequestedApplicationCount()) .applicationApprovedCount(recruitment.getApprovedApplicationCount()) .recruitmentCount(recruitment.getTotalHiring()) - .recruitmentJob(getJobKeywords(recruitment.getJobCodes())) + .recruitmentJob(getKeywordsService.getKeywordsAsList(recruitment.getJobCodes())) .companyId(recruitment.getCompanyId()) .build() ).toList(); @@ -74,13 +72,4 @@ public TotalPageCountResponse getTotalPageCount(String companyName, LocalDate st return new TotalPageCountResponse(totalPageCount); } - - private String getJobKeywords(String jobCodes) { - return StringUtil.joinStringList( - queryCodePort.queryCodesByIdIn( - StringUtil.divideString(jobCodes, ",").stream().map(Long::parseLong).toList() - ).stream().map(Code::getKeyword).toList(), - "/" - ); - } } From 09ddad27ded5c6d6b9fc224aecb034905f953e16 Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Thu, 16 Nov 2023 11:03:05 +0900 Subject: [PATCH 03/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#449)=20?= =?UTF-8?q?=EC=A0=84=EC=B2=B4=20=EC=83=9D=EC=84=B1=EC=9E=90=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/recruitment/dto/response/RecruitAreaResponse.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java index e7d78e07f..29b10e968 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java @@ -1,11 +1,13 @@ package team.retum.jobis.domain.recruitment.dto.response; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import java.util.List; @Getter +@AllArgsConstructor @Builder public class RecruitAreaResponse { From e74e3e6a4906778f396a54daefaefb65bf996908 Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Thu, 16 Nov 2023 13:04:22 +0900 Subject: [PATCH 04/45] =?UTF-8?q?=F0=9F=9B=A0=20::=20(#449)=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=9D=98?= =?UTF-8?q?=EC=A1=B4=EC=84=B1=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/usecase/QueryRecruitmentDetailUseCase.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java index 4b19b98ac..4d2fad287 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java @@ -2,17 +2,13 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; -import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; -import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; @RequiredArgsConstructor @ReadOnlyUseCase public class QueryRecruitmentDetailUseCase { - private final QueryRecruitmentPort queryRecruitmentPort; - private final GetKeywordsService getKeywordsService; private final GetRecruitmentDetailService getRecruitmentDetailService; public QueryRecruitmentDetailResponse execute(Long recruitId) { From 3d44ccc0c76d60cbb4ddcfc93a2de58bb8b85333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B8=B8=EA=B7=BC=EC=9A=B0?= <103028187+gilgeunwoo@users.noreply.github.com> Date: Thu, 16 Nov 2023 01:18:03 +0900 Subject: [PATCH 05/45] =?UTF-8?q?Revert=20"=F0=9F=94=97=20::=20(#444)=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=82=AC=EC=9A=A9=EC=97=AC=EB=B6=80=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/team/retum/jobis/domain/code/model/Code.java | 2 -- .../recruitment/service/SaveRecruitmentAreaService.java | 1 + .../domain/code/persistence/CodePersistenceAdapter.java | 1 - .../jobis/domain/code/persistence/entity/CodeEntity.java | 7 +------ .../jobis/domain/code/persistence/mapper/CodeMapper.java | 2 -- 5 files changed, 2 insertions(+), 11 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/code/model/Code.java b/jobis-application/src/main/java/team/retum/jobis/domain/code/model/Code.java index b3c507a50..99bb6e265 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/code/model/Code.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/code/model/Code.java @@ -18,6 +18,4 @@ public class Code { private final String keyword; private final Long parentCodeId; - - private final boolean isUsed; } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java index 2985e91b7..10bedd706 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java @@ -3,6 +3,7 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.Service; import team.retum.jobis.domain.code.model.RecruitAreaCode; +import team.retum.jobis.domain.code.spi.QueryCodePort; import team.retum.jobis.domain.recruitment.dto.request.CreateRecruitAreaRequest; import team.retum.jobis.domain.recruitment.model.RecruitArea; import team.retum.jobis.domain.recruitment.spi.CommandRecruitmentPort; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java index 10fd73ed4..da13ab748 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java @@ -29,7 +29,6 @@ public List queryCodesByKeywordAndType(String keyword, CodeType codeType, .selectFrom(codeEntity) .where( codeEntity.codeType.eq(codeType), - codeEntity.isUsed.eq(true), containsKeyword(keyword), eqParentCode(parentCode) ).fetch().stream() diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java index 5dcdc6447..832c48156 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java @@ -47,17 +47,12 @@ public class CodeEntity { @JoinColumn(name = "parent_code_id") private CodeEntity parentCode; - @NotNull - @Column(columnDefinition = "BIT(1)") - private boolean isUsed; - @Builder - public CodeEntity(Long id, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity, boolean isUsed) { + public CodeEntity(Long id, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity) { this.id = id; this.codeType = codeType; this.jobType = jobType; this.keyword = keyword; this.parentCode = parentCodeEntity; - this.isUsed = isUsed; } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java index 8418802b3..a131b01e8 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java @@ -24,7 +24,6 @@ public CodeEntity toEntity(Code domain) { .keyword(domain.getKeyword()) .jobType(domain.getJobType()) .parentCodeEntity(code) - .isUsed(domain.isUsed()) .build(); } @@ -35,7 +34,6 @@ public Code toDomain(CodeEntity entity) { .jobType(entity.getJobType()) .keyword(entity.getKeyword()) .parentCodeId(entity.getParentCode() == null ? null : entity.getParentCode().getId()) - .isUsed(entity.isUsed()) .build(); } } From 706074c987407e7a794bf27f392c074dfe2fb129 Mon Sep 17 00:00:00 2001 From: Kangmin Date: Wed, 15 Nov 2023 23:13:50 +0900 Subject: [PATCH 06/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#449)=20jobcod?= =?UTF-8?q?e=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/RecruitAreaResponse.java | 2 ++ .../usecase/QueryMyRecruitmentUseCase.java | 22 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java index 22950688f..29b10e968 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java @@ -1,12 +1,14 @@ package team.retum.jobis.domain.recruitment.dto.response; import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; import java.util.List; @Getter @AllArgsConstructor +@Builder public class RecruitAreaResponse { private final Long id; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java index 04a426b14..f4d1d328c 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java @@ -3,6 +3,8 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.spi.SecurityPort; +import team.retum.jobis.domain.code.model.Code; +import team.retum.jobis.domain.code.spi.QueryCodePort; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; @@ -18,6 +20,7 @@ public class QueryMyRecruitmentUseCase { private final SecurityPort securityPort; private final QueryRecruitmentPort queryRecruitmentPort; + private final QueryCodePort queryCodePort; public QueryRecruitmentDetailResponse execute() { Long currentUserId = securityPort.getCurrentUserId(); @@ -25,10 +28,25 @@ public QueryRecruitmentDetailResponse execute() { Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(currentUserId) .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); List recruitAreaResponses = - queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()); + queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()) + .stream().map(recruitAreaResponse -> RecruitAreaResponse.builder() + .id(recruitAreaResponse.getId()) + .job(getJobKeywords(recruitAreaResponse.getJob())) + .tech(recruitAreaResponse.getTech()) + .hiring(recruitAreaResponse.getHiring()) + .majorTask(recruitAreaResponse.getMajorTask()) + .preferentialTreatment(recruitAreaResponse.getPreferentialTreatment()) + .build() + ).toList(); + return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); } + + private List getJobKeywords(List jobCodes) { + return queryCodePort.queryCodesByIdIn( + jobCodes.stream().map(Long::parseLong).toList() + ).stream().map(Code::getKeyword).toList(); + } } From a42bc1000b8df8f19d2ab52d146aab1fbbdf2deb Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Thu, 16 Nov 2023 09:38:47 +0900 Subject: [PATCH 07/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#449)=20service=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/service/GetKeywordsService.java | 31 ++++++++++++++ .../dto/response/RecruitAreaResponse.java | 2 - .../service/GetRecruitmentDetailService.java | 41 +++++++++++++++++++ .../usecase/QueryMyRecruitmentUseCase.java | 37 ++--------------- .../QueryRecruitmentDetailUseCase.java | 33 +++------------ .../StudentQueryRecruitmentsUseCase.java | 17 ++------ .../TeacherQueryRecruitmentsUseCase.java | 17 ++------ 7 files changed, 86 insertions(+), 92 deletions(-) create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java new file mode 100644 index 000000000..5df3bd985 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java @@ -0,0 +1,31 @@ +package team.retum.jobis.domain.code.service; + +import lombok.RequiredArgsConstructor; +import team.retum.jobis.common.annotation.Service; +import team.retum.jobis.common.util.StringUtil; +import team.retum.jobis.domain.code.model.Code; +import team.retum.jobis.domain.code.spi.QueryCodePort; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class GetKeywordsService { + + private final QueryCodePort queryCodePort; + + public String getKeywordsAsList(String jobCodes) { + return StringUtil.joinStringList( + queryCodePort.queryCodesByIdIn( + StringUtil.divideString(jobCodes, ",").stream().map(Long::parseLong).toList() + ).stream().map(Code::getKeyword).toList(), + "/" + ); + } + + public List getKeywordsAsList(List jobCodes) { + return queryCodePort.queryCodesByIdIn( + jobCodes.stream().map(Long::parseLong).toList() + ).stream().map(Code::getKeyword).toList(); + } +} diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java index 29b10e968..e7d78e07f 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java @@ -1,13 +1,11 @@ package team.retum.jobis.domain.recruitment.dto.response; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import java.util.List; @Getter -@AllArgsConstructor @Builder public class RecruitAreaResponse { diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java new file mode 100644 index 000000000..d6a4fb452 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java @@ -0,0 +1,41 @@ +package team.retum.jobis.domain.recruitment.service; + +import lombok.RequiredArgsConstructor; +import team.retum.jobis.common.annotation.Service; +import team.retum.jobis.domain.code.service.GetKeywordsService; +import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; +import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; +import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; +import team.retum.jobis.domain.recruitment.model.Recruitment; +import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; +import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class GetRecruitmentDetailService { + + private final QueryRecruitmentPort queryRecruitmentPort; + private final GetKeywordsService getKeywordsService; + + public QueryRecruitmentDetailResponse execute(Long recruitId) { + + Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(recruitId) + .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); + + RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); + List recruitAreaResponses = queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()) + .stream().map(recruitAreaResponse -> RecruitAreaResponse.builder() + .id(recruitAreaResponse.getId()) + .job(getKeywordsService.getKeywordsAsList(recruitAreaResponse.getJob())) + .tech(recruitAreaResponse.getTech()) + .hiring(recruitAreaResponse.getHiring()) + .majorTask(recruitAreaResponse.getMajorTask()) + .preferentialTreatment(recruitAreaResponse.getPreferentialTreatment()) + .build() + ).toList(); + + return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); + } +} diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java index f4d1d328c..8fa4acc5a 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java @@ -3,50 +3,19 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.spi.SecurityPort; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; -import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; -import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; -import team.retum.jobis.domain.recruitment.model.Recruitment; -import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; -import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO; - -import java.util.List; +import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; @RequiredArgsConstructor @ReadOnlyUseCase public class QueryMyRecruitmentUseCase { private final SecurityPort securityPort; - private final QueryRecruitmentPort queryRecruitmentPort; - private final QueryCodePort queryCodePort; + private final GetRecruitmentDetailService getRecruitmentDetailService; public QueryRecruitmentDetailResponse execute() { Long currentUserId = securityPort.getCurrentUserId(); - Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(currentUserId) - .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - - RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); - List recruitAreaResponses = - queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()) - .stream().map(recruitAreaResponse -> RecruitAreaResponse.builder() - .id(recruitAreaResponse.getId()) - .job(getJobKeywords(recruitAreaResponse.getJob())) - .tech(recruitAreaResponse.getTech()) - .hiring(recruitAreaResponse.getHiring()) - .majorTask(recruitAreaResponse.getMajorTask()) - .preferentialTreatment(recruitAreaResponse.getPreferentialTreatment()) - .build() - ).toList(); - - return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); - } - - private List getJobKeywords(List jobCodes) { - return queryCodePort.queryCodesByIdIn( - jobCodes.stream().map(Long::parseLong).toList() - ).stream().map(Code::getKeyword).toList(); + return getRecruitmentDetailService.execute(currentUserId); } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java index 4049cf776..4b19b98ac 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java @@ -2,44 +2,21 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; +import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; -import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; -import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; -import team.retum.jobis.domain.recruitment.model.Recruitment; +import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; -import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO; - -import java.util.List; @RequiredArgsConstructor @ReadOnlyUseCase public class QueryRecruitmentDetailUseCase { private final QueryRecruitmentPort queryRecruitmentPort; - private final QueryCodePort queryCodePort; + private final GetKeywordsService getKeywordsService; + private final GetRecruitmentDetailService getRecruitmentDetailService; public QueryRecruitmentDetailResponse execute(Long recruitId) { - Recruitment recruitment = queryRecruitmentPort.queryRecruitmentById(recruitId) - .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - - RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); - List recruitAreaResponses = - queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()).stream() - .map(area -> - new RecruitAreaResponse( - area.getId(), - queryCodePort.queryCodesByIdIn(area.getJob().stream().map(Long::parseLong).toList()).stream() - .map(Code::getKeyword) - .toList(), - area.getTech(), - area.getHiring(), - area.getMajorTask(), - area.getPreferentialTreatment() - ) - ).toList(); - return QueryRecruitmentDetailResponse.of(recruitmentDetail, recruitAreaResponses); + return getRecruitmentDetailService.execute(recruitId); } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java index 9ea09074b..cc7d0fe4d 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java @@ -5,9 +5,7 @@ import team.retum.jobis.common.dto.response.TotalPageCountResponse; import team.retum.jobis.common.spi.SecurityPort; import team.retum.jobis.common.util.NumberUtil; -import team.retum.jobis.common.util.StringUtil; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; +import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; import team.retum.jobis.domain.recruitment.dto.response.StudentQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.StudentQueryRecruitmentsResponse.StudentRecruitmentResponse; @@ -23,7 +21,7 @@ public class StudentQueryRecruitmentsUseCase { private final QueryRecruitmentPort queryRecruitmentPort; private final SecurityPort securityPort; - private final QueryCodePort queryCodePort; + private final GetKeywordsService getKeywordsService; public StudentQueryRecruitmentsResponse execute( String name, @@ -50,7 +48,7 @@ public StudentQueryRecruitmentsResponse execute( .recruitId(recruitment.getRecruitmentId()) .companyName(recruitment.getCompanyName()) .trainPay(recruitment.getTrainPay()) - .jobCodeList(getJobKeywords(recruitment.getJobCodes())) + .jobCodeList(getKeywordsService.getKeywordsAsList(recruitment.getJobCodes())) .military(recruitment.isMilitarySupport()) .companyProfileUrl(recruitment.getCompanyLogoUrl()) .totalHiring(recruitment.getTotalHiring()) @@ -80,13 +78,4 @@ public TotalPageCountResponse getTotalPageCount(String name, Long jobCode, List< return new TotalPageCountResponse(totalPageCount); } - - private String getJobKeywords(String jobCodes) { - return StringUtil.joinStringList( - queryCodePort.queryCodesByIdIn( - StringUtil.divideString(jobCodes, ",").stream().map(Long::parseLong).toList() - ).stream().map(Code::getKeyword).toList(), - "/" - ); - } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java index 74c639abf..704d51012 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java @@ -4,9 +4,7 @@ import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.dto.response.TotalPageCountResponse; import team.retum.jobis.common.util.NumberUtil; -import team.retum.jobis.common.util.StringUtil; -import team.retum.jobis.domain.code.model.Code; -import team.retum.jobis.domain.code.spi.QueryCodePort; +import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; import team.retum.jobis.domain.recruitment.dto.response.TeacherQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.TeacherQueryRecruitmentsResponse.TeacherRecruitmentResponse; @@ -21,7 +19,7 @@ public class TeacherQueryRecruitmentsUseCase { private final QueryRecruitmentPort queryRecruitmentPort; - private final QueryCodePort queryCodePort; + private final GetKeywordsService getKeywordsService; public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate start, LocalDate end, Integer year, RecruitStatus status, Long page) { @@ -49,7 +47,7 @@ public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate st .applicationRequestedCount(recruitment.getRequestedApplicationCount()) .applicationApprovedCount(recruitment.getApprovedApplicationCount()) .recruitmentCount(recruitment.getTotalHiring()) - .recruitmentJob(getJobKeywords(recruitment.getJobCodes())) + .recruitmentJob(getKeywordsService.getKeywordsAsList(recruitment.getJobCodes())) .companyId(recruitment.getCompanyId()) .build() ).toList(); @@ -74,13 +72,4 @@ public TotalPageCountResponse getTotalPageCount(String companyName, LocalDate st return new TotalPageCountResponse(totalPageCount); } - - private String getJobKeywords(String jobCodes) { - return StringUtil.joinStringList( - queryCodePort.queryCodesByIdIn( - StringUtil.divideString(jobCodes, ",").stream().map(Long::parseLong).toList() - ).stream().map(Code::getKeyword).toList(), - "/" - ); - } } From d144274feac74bf9be61f846e6b448d0b9117de8 Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Thu, 16 Nov 2023 11:03:05 +0900 Subject: [PATCH 08/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#449)=20?= =?UTF-8?q?=EC=A0=84=EC=B2=B4=20=EC=83=9D=EC=84=B1=EC=9E=90=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/recruitment/dto/response/RecruitAreaResponse.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java index e7d78e07f..29b10e968 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitAreaResponse.java @@ -1,11 +1,13 @@ package team.retum.jobis.domain.recruitment.dto.response; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import java.util.List; @Getter +@AllArgsConstructor @Builder public class RecruitAreaResponse { From 850136108213d5fd14cacf2115036891e3dcefb6 Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Thu, 16 Nov 2023 13:04:22 +0900 Subject: [PATCH 09/45] =?UTF-8?q?=F0=9F=9B=A0=20::=20(#449)=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=9D=98?= =?UTF-8?q?=EC=A1=B4=EC=84=B1=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/usecase/QueryRecruitmentDetailUseCase.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java index 4b19b98ac..4d2fad287 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java @@ -2,17 +2,13 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; -import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; -import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; @RequiredArgsConstructor @ReadOnlyUseCase public class QueryRecruitmentDetailUseCase { - private final QueryRecruitmentPort queryRecruitmentPort; - private final GetKeywordsService getKeywordsService; private final GetRecruitmentDetailService getRecruitmentDetailService; public QueryRecruitmentDetailResponse execute(Long recruitId) { From a002ba138d72809e06d8b7fe495cfc4d690cf4c2 Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Thu, 16 Nov 2023 13:13:23 +0900 Subject: [PATCH 10/45] =?UTF-8?q?=F0=9F=9B=A0=20::=20(#449)=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../retum/jobis/domain/code/service/GetKeywordsService.java | 2 +- .../recruitment/usecase/StudentQueryRecruitmentsUseCase.java | 2 +- .../recruitment/usecase/TeacherQueryRecruitmentsUseCase.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java index 5df3bd985..fdde6188e 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java @@ -14,7 +14,7 @@ public class GetKeywordsService { private final QueryCodePort queryCodePort; - public String getKeywordsAsList(String jobCodes) { + public String getKeywordsAsJoinedString(String jobCodes) { return StringUtil.joinStringList( queryCodePort.queryCodesByIdIn( StringUtil.divideString(jobCodes, ",").stream().map(Long::parseLong).toList() diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java index cc7d0fe4d..10696c8b1 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java @@ -48,7 +48,7 @@ public StudentQueryRecruitmentsResponse execute( .recruitId(recruitment.getRecruitmentId()) .companyName(recruitment.getCompanyName()) .trainPay(recruitment.getTrainPay()) - .jobCodeList(getKeywordsService.getKeywordsAsList(recruitment.getJobCodes())) + .jobCodeList(getKeywordsService.getKeywordsAsJoinedString(recruitment.getJobCodes())) .military(recruitment.isMilitarySupport()) .companyProfileUrl(recruitment.getCompanyLogoUrl()) .totalHiring(recruitment.getTotalHiring()) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java index 704d51012..6f720bdfc 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java @@ -47,7 +47,7 @@ public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate st .applicationRequestedCount(recruitment.getRequestedApplicationCount()) .applicationApprovedCount(recruitment.getApprovedApplicationCount()) .recruitmentCount(recruitment.getTotalHiring()) - .recruitmentJob(getKeywordsService.getKeywordsAsList(recruitment.getJobCodes())) + .recruitmentJob(getKeywordsService.getKeywordsAsJoinedString(recruitment.getJobCodes())) .companyId(recruitment.getCompanyId()) .build() ).toList(); From cf1c081ca666b2b2517fb7aa85383d3b81a563ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Thu, 16 Nov 2023 17:03:28 +0900 Subject: [PATCH 11/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#455)=20=EB=8F=99?= =?UTF-8?q?=EA=B3=84=EC=9D=B8=ED=84=B4=20=EC=97=AC=EB=B6=80=20=EC=BB=AC?= =?UTF-8?q?=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobis/domain/recruitment/model/Recruitment.java | 2 ++ .../persistence/entity/RecruitmentEntity.java | 9 +++++++-- .../persistence/mapper/RecruitmentMapper.java | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java index 17ef7fd3b..82458d8b8 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java @@ -49,6 +49,8 @@ public class Recruitment { private final boolean personalContract; + private final boolean winterIntern; + private final Long companyId; public Recruitment update(Integer trainPay, String pay, LocalTime startTime, LocalTime endTime, String submitDocument, diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java index 6c3f662e8..ddd99aa8e 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java @@ -95,9 +95,13 @@ public class RecruitmentEntity extends BaseTimeEntity { private PayInfo payInfo; @NotNull - @Column(columnDefinition = "BIT(1)") + @Column(columnDefinition = "TINYINT(1)") private Boolean personalContact; + @NotNull + @Column(columnDefinition = "TINYINT(1)") + private Boolean winterIntern; + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "company_id", nullable = false) private CompanyEntity company; @@ -113,7 +117,7 @@ public RecruitmentEntity(Long id, int recruitYear, RecruitStatus status, Integer LocalTime startTime, LocalTime endTime, String submitDocument, LocalDate startDate, LocalDate endDate, CompanyEntity companyEntity, String benefits, boolean militarySupport, List requiredLicenses, String etc, List hiringProgress, - Integer requiredGrade, Boolean personalContact) { + Integer requiredGrade, Boolean personalContact, Boolean winterIntern) { this.id = id; this.workingHour = new WorkingHour(startTime, endTime); this.hiringProgress = hiringProgress; @@ -128,6 +132,7 @@ public RecruitmentEntity(Long id, int recruitYear, RecruitStatus status, Integer this.company = companyEntity; this.requiredLicenses = requiredLicenses; this.militarySupport = militarySupport; + this.winterIntern = winterIntern; this.etc = etc; } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java index 32e652723..29c6f3e0d 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java @@ -38,6 +38,7 @@ public RecruitmentEntity toEntity(Recruitment domain) { .submitDocument(domain.getSubmitDocument()) .startTime(domain.getStartTime()) .endTime(domain.getEndTime()) + .winterIntern(domain.isWinterIntern()) .build(); } @@ -62,6 +63,7 @@ public Recruitment toDomain(RecruitmentEntity entity) { .submitDocument(entity.getSubmitDocument()) .startTime(entity.getWorkingHour().getStartTime()) .endTime(entity.getWorkingHour().getEndTime()) + .winterIntern(entity.getWinterIntern()) .build(); } } From aeca00658e8d9f85d4bd043de81136feb10a90af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Fri, 17 Nov 2023 08:46:51 +0900 Subject: [PATCH 12/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#455)=20primitive=20?= =?UTF-8?q?type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/persistence/entity/RecruitmentEntity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java index ddd99aa8e..5d3c5ac41 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java @@ -74,7 +74,7 @@ public class RecruitmentEntity extends BaseTimeEntity { @NotNull @Column(columnDefinition = "BIT(1)") - private Boolean militarySupport; + private boolean militarySupport; @NotNull @Convert(converter = HiringProgressConverter.class) @@ -96,11 +96,11 @@ public class RecruitmentEntity extends BaseTimeEntity { @NotNull @Column(columnDefinition = "TINYINT(1)") - private Boolean personalContact; + private boolean personalContact; @NotNull @Column(columnDefinition = "TINYINT(1)") - private Boolean winterIntern; + private boolean winterIntern; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "company_id", nullable = false) @@ -117,7 +117,7 @@ public RecruitmentEntity(Long id, int recruitYear, RecruitStatus status, Integer LocalTime startTime, LocalTime endTime, String submitDocument, LocalDate startDate, LocalDate endDate, CompanyEntity companyEntity, String benefits, boolean militarySupport, List requiredLicenses, String etc, List hiringProgress, - Integer requiredGrade, Boolean personalContact, Boolean winterIntern) { + Integer requiredGrade, boolean personalContact, boolean winterIntern) { this.id = id; this.workingHour = new WorkingHour(startTime, endTime); this.hiringProgress = hiringProgress; From ef9ea5d37ef785c0c6862d5040822338656b4332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Fri, 17 Nov 2023 08:53:40 +0900 Subject: [PATCH 13/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#455)=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/CreateApplicationUseCase.java | 4 +--- .../retum/jobis/domain/recruitment/model/Recruitment.java | 7 ++++++- .../team/retum/jobis/domain/student/model/Student.java | 6 ------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CreateApplicationUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CreateApplicationUseCase.java index 79208238c..f4b460a49 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CreateApplicationUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CreateApplicationUseCase.java @@ -28,11 +28,9 @@ public class CreateApplicationUseCase { public void execute(CreateApplicationRequest request, Long recruitmentId) { Student student = securityPort.getCurrentStudent(); - student.checkIs3rdGrade(); - Recruitment recruitment = queryRecruitmentPort.queryRecruitmentById(recruitmentId) .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - recruitment.checkIsApplicable(); + recruitment.checkIsApplicable(student.getGrade()); if (queryApplicationPort.existsApplicationByStudentIdAndApplicationStatusIn( student.getId(), ApplicationStatus.DUPLICATE_CHECK diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java index 82458d8b8..9c50425e1 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/Recruitment.java @@ -3,6 +3,7 @@ import lombok.Builder; import lombok.Getter; import team.retum.jobis.common.annotation.Aggregate; +import team.retum.jobis.domain.application.exception.InvalidGradeException; import team.retum.jobis.domain.recruitment.exception.CompanyMismatchException; import team.retum.jobis.domain.recruitment.exception.InvalidRecruitmentStatusException; @@ -86,9 +87,13 @@ public void checkCompany(Long companyId) { } } - public void checkIsApplicable() { + public void checkIsApplicable(Integer studentGrade) { if (this.status != RecruitStatus.RECRUITING) { throw InvalidRecruitmentStatusException.EXCEPTION; } + + if (studentGrade == 1 || (!this.winterIntern && studentGrade == 2)) { + throw InvalidGradeException.EXCEPTION; + } } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java index 0e990f46c..b76e3cc5c 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java @@ -46,12 +46,6 @@ public static Department getDepartment(Integer grade, Integer classRoom) { }; } - public void checkIs3rdGrade() { - if (!this.grade.equals(3)) { - throw InvalidGradeException.EXCEPTION; - } - } - public Student changeStudentProfile(String profileImageUrl) { return this.toBuilder() .profileImageUrl(profileImageUrl) From 10a1dbd61771a5a8bb6760e56140ffb6d1ea0efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Fri, 17 Nov 2023 08:57:15 +0900 Subject: [PATCH 14/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20hu?= =?UTF-8?q?man=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/persistence/mapper/RecruitmentMapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java index 29c6f3e0d..7eb5443c3 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitmentMapper.java @@ -50,8 +50,8 @@ public Recruitment toDomain(RecruitmentEntity entity) { .recruitYear(entity.getRecruitYear()) .benefits(entity.getBenefits()) .hiringProgress(entity.getHiringProgress()) - .personalContract(entity.getPersonalContact()) - .militarySupport(entity.getMilitarySupport()) + .personalContract(entity.isPersonalContact()) + .militarySupport(entity.isMilitarySupport()) .status(entity.getStatus()) .startDate(entity.getRecruitDate().getStartDate()) .endDate(entity.getRecruitDate().getFinishDate()) @@ -63,7 +63,7 @@ public Recruitment toDomain(RecruitmentEntity entity) { .submitDocument(entity.getSubmitDocument()) .startTime(entity.getWorkingHour().getStartTime()) .endTime(entity.getWorkingHour().getEndTime()) - .winterIntern(entity.getWinterIntern()) + .winterIntern(entity.isWinterIntern()) .build(); } } From 82a1f3d9ab61fd3024d2f08c1f1a8d41127bc515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Fri, 17 Nov 2023 09:11:54 +0900 Subject: [PATCH 15/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20ti?= =?UTF-8?q?nyint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/company/persistence/entity/CompanyEntity.java | 4 ++-- .../recruitment/persistence/entity/RecruitmentEntity.java | 2 +- jobis-infrastructure/src/main/resources/application.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java index a0482af7d..e73fa204f 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java @@ -66,8 +66,8 @@ public class CompanyEntity { private CompanyType type; @NotNull - @Column(columnDefinition = "BIT(1)") - private Boolean isMou; + @Column(columnDefinition = "TINYINT(1)") + private boolean isMou; @Embedded private Address address; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java index 5d3c5ac41..6ccc685fb 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java @@ -73,7 +73,7 @@ public class RecruitmentEntity extends BaseTimeEntity { private String benefits; @NotNull - @Column(columnDefinition = "BIT(1)") + @Column(columnDefinition = "TINYINT(1)") private boolean militarySupport; @NotNull diff --git a/jobis-infrastructure/src/main/resources/application.yml b/jobis-infrastructure/src/main/resources/application.yml index eab91368f..23362ff4a 100644 --- a/jobis-infrastructure/src/main/resources/application.yml +++ b/jobis-infrastructure/src/main/resources/application.yml @@ -1,14 +1,14 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://${DB_URL:localhost}:3306/${DB_NAME:jobis}?useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true + url: jdbc:mysql://${DB_URL:localhost}:3306/${DB_NAME:jobis}?useSSL=false&?tinyInt1isBit=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true username: ${DB_USERNAME:root} password: ${DB_PASSWORD:11111111} jpa: database-platform: team.retum.jobis.global.config.MysqlDialectConfig hibernate: - ddl-auto: validate + ddl-auto: ${DDL:validate} properties.hibernate: format_sql: true show_sql: ${SHOW_SQL:true} From 0091556d37f2580d88b40e40ec6fe30e1333ef7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Fri, 17 Nov 2023 09:22:00 +0900 Subject: [PATCH 16/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20sy?= =?UTF-8?q?ntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobis/domain/company/persistence/mapper/CompanyMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java index 3b5877515..6d1484532 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java @@ -57,7 +57,7 @@ public Company toDomain(CompanyEntity entity) { .email(entity.getEmail()) .bizNo(entity.getBizNo()) .type(entity.getType()) - .isMou(entity.getIsMou()) + .isMou(entity.isMou()) .companyIntroduce(entity.getCompanyIntroduce()) .businessArea(entity.getBusinessArea()) .companyLogoUrl(entity.getCompanyLogoUrl()) From 19cd1fc23d7a25637618fbee3822452d78893084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Fri, 17 Nov 2023 09:28:17 +0900 Subject: [PATCH 17/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20qu?= =?UTF-8?q?ery=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jobis-infrastructure/src/main/resources/application.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jobis-infrastructure/src/main/resources/application.yml b/jobis-infrastructure/src/main/resources/application.yml index 23362ff4a..5555785ab 100644 --- a/jobis-infrastructure/src/main/resources/application.yml +++ b/jobis-infrastructure/src/main/resources/application.yml @@ -1,14 +1,14 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://${DB_URL:localhost}:3306/${DB_NAME:jobis}?useSSL=false&?tinyInt1isBit=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true + url: jdbc:mysql://${DB_URL:localhost}:3306/${DB_NAME:jobis}?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&tinyInt1isBit=false&rewriteBatchedStatements=true username: ${DB_USERNAME:root} password: ${DB_PASSWORD:11111111} jpa: database-platform: team.retum.jobis.global.config.MysqlDialectConfig hibernate: - ddl-auto: ${DDL:validate} + ddl-auto: properties.hibernate: format_sql: true show_sql: ${SHOW_SQL:true} From c296f90a0c49e36b349cc43c4164e54600ce1dd6 Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sat, 18 Nov 2023 22:30:24 +0900 Subject: [PATCH 18/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#458)=20=EC=9E=85?= =?UTF-8?q?=ED=95=99=EB=85=84=EB=8F=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobis/domain/student/model/Student.java | 4 ++++ .../student/usecase/StudentSignUpUseCase.java | 19 +++++++++++++++++++ .../persistence/entity/StudentEntity.java | 8 +++++++- .../persistence/mapper/StudentMapper.java | 2 ++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java index b76e3cc5c..30b5e3f48 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java @@ -6,6 +6,8 @@ import team.retum.jobis.domain.application.exception.InvalidGradeException; import team.retum.jobis.domain.student.exception.ClassRoomNotFoundException; +import java.time.Year; + @Getter @Builder(toBuilder = true) @Aggregate @@ -27,6 +29,8 @@ public class Student { private final String profileImageUrl; + private final Year entranceYear; + public static String processGcn(int grade, int classNumber, int number) { return String.valueOf(grade) + classNumber + diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java index 72c3d8610..8898ed223 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java @@ -18,6 +18,9 @@ import team.retum.jobis.domain.user.spi.CommandUserPort; import team.retum.jobis.domain.user.spi.QueryUserPort; +import java.time.Period; +import java.time.Year; + @RequiredArgsConstructor @UseCase public class StudentSignUpUseCase { @@ -68,6 +71,7 @@ public TokenResponse execute(StudentSignUpRequest request) { ) ) .profileImageUrl(request.getProfileImageUrl()) + .entranceYear(getEntranceYear(request.getGrade())) .build() ); @@ -82,4 +86,19 @@ public TokenResponse execute(StudentSignUpRequest request) { return jwtPort.generateTokens(userEntity.getId(), userEntity.getAuthority()); } + + private Year getEntranceYear(Integer grade) { + Year year = Year.now(); + switch (grade) { + case 2 -> { + return year.minus(Period.ofYears(1)); + } + case 3 -> { + return year.minus(Period.ofYears(2)); + } + default -> { + return year; + } + } + } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java index a46026271..7477092fe 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java @@ -27,6 +27,7 @@ import javax.persistence.Table; import javax.persistence.UniqueConstraint; import javax.validation.constraints.NotNull; +import java.time.Year; import java.util.ArrayList; import java.util.List; @@ -83,6 +84,10 @@ public class StudentEntity { @Column(columnDefinition = "VARCHAR(300)", nullable = false) private String profileImageUrl; + @NotNull + @Column(columnDefinition = "YEAR") + private Year entranceYear; + @OneToMany(mappedBy = "student", orphanRemoval = true) private final List applications = new ArrayList<>(); @@ -92,7 +97,7 @@ public class StudentEntity { @Builder public StudentEntity(Long id, UserEntity userEntity, String name, Integer grade, Integer classRoom, Integer number, Gender gender, - Department department, String profileImageUrl) { + Department department, String profileImageUrl, Year entranceYear) { this.id = id; this.userEntity = userEntity; this.name = name; @@ -102,5 +107,6 @@ public StudentEntity(Long id, UserEntity userEntity, String name, Integer grade, this.gender = gender; this.department = department; this.profileImageUrl = profileImageUrl; + this.entranceYear = entranceYear; } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/mapper/StudentMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/mapper/StudentMapper.java index 2bcc196bb..50d40076e 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/mapper/StudentMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/mapper/StudentMapper.java @@ -27,6 +27,7 @@ public StudentEntity toEntity(Student domain) { .department(domain.getDepartment()) .profileImageUrl(domain.getProfileImageUrl()) .number(domain.getNumber()) + .entranceYear(domain.getEntranceYear()) .userEntity(user) .build(); } @@ -41,6 +42,7 @@ public Student toDomain(StudentEntity entity) { .classRoom(entity.getClassRoom()) .department(entity.getDepartment()) .grade(entity.getGrade()) + .entranceYear(entity.getEntranceYear()) .build(); } } From a769a2e7ce686f7bff29751b4fd82c81f01d724f Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sat, 18 Nov 2023 22:59:20 +0900 Subject: [PATCH 19/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#458)=20application?= =?UTF-8?q?=20=EC=A1=B0=EC=9D=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../retum/jobis/domain/acceptance/model/Acceptance.java | 2 ++ .../acceptance/persistence/entity/AcceptanceEntity.java | 8 +++++++- .../acceptance/persistence/mapper/AcceptanceMapper.java | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java index 685f6391e..9ee2d7cbf 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java @@ -27,4 +27,6 @@ public class Acceptance { private final LocalDate contractDate; private final Long companyId; + + private final Long applicationId; } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java index 093eb3eef..e70867fd8 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java @@ -4,6 +4,7 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import team.retum.jobis.domain.application.persistence.entity.ApplicationEntity; import team.retum.jobis.domain.company.persistence.entity.CompanyEntity; import team.retum.jobis.global.converter.StringListConverter; @@ -60,9 +61,13 @@ public class AcceptanceEntity { @JoinColumn(name = "company_id", nullable = false) private CompanyEntity company; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "application_id", nullable = false) + private ApplicationEntity application; + @Builder public AcceptanceEntity(Long id, Integer year, String studentName, String businessArea, List tech, - String studentGcn, LocalDate contractDate, CompanyEntity companyEntity) { + String studentGcn, LocalDate contractDate, CompanyEntity companyEntity, ApplicationEntity application) { this.id = id; this.year = year; this.studentName = studentName; @@ -71,5 +76,6 @@ public AcceptanceEntity(Long id, Integer year, String studentName, String busine this.studentGcn = studentGcn; this.contractDate = contractDate; this.company = companyEntity; + this.application = application; } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java index 879cb4dd1..6bd648a84 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java @@ -4,6 +4,9 @@ import org.springframework.stereotype.Component; import team.retum.jobis.domain.acceptance.model.Acceptance; import team.retum.jobis.domain.acceptance.persistence.entity.AcceptanceEntity; +import team.retum.jobis.domain.application.exception.ApplicationNotFoundException; +import team.retum.jobis.domain.application.persistence.entity.ApplicationEntity; +import team.retum.jobis.domain.application.persistence.repository.ApplicationJpaRepository; import team.retum.jobis.domain.company.exception.CompanyNotFoundException; import team.retum.jobis.domain.company.persistence.entity.CompanyEntity; import team.retum.jobis.domain.company.persistence.repository.CompanyJpaRepository; @@ -13,10 +16,13 @@ public class AcceptanceMapper { private final CompanyJpaRepository companyJpaRepository; + private final ApplicationJpaRepository applicationJpaRepository; public AcceptanceEntity toEntity(Acceptance domain) { CompanyEntity company = companyJpaRepository.findById(domain.getCompanyId()) .orElseThrow(() -> CompanyNotFoundException.EXCEPTION); + ApplicationEntity application = applicationJpaRepository.findById(domain.getApplicationId()) + .orElseThrow(() -> ApplicationNotFoundException.EXCEPTION); return AcceptanceEntity.builder() .id(domain.getId()) @@ -27,6 +33,7 @@ public AcceptanceEntity toEntity(Acceptance domain) { .studentName(domain.getStudentName()) .studentGcn(domain.getStudentGcn()) .tech(domain.getTech()) + .application(application) .build(); } @@ -39,6 +46,7 @@ public Acceptance toDomain(AcceptanceEntity entity) { .studentGcn(entity.getStudentGcn()) .id(entity.getId()) .companyId(entity.getCompany().getId()) + .applicationId(entity.getApplication().getId()) .build(); } } From 207292c50f9f1ca8f692c1054954687bdcfab8b7 Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sat, 18 Nov 2023 22:59:56 +0900 Subject: [PATCH 20/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#458)=20=EA=B7=BC?= =?UTF-8?q?=EB=A1=9C=EA=B3=84=EC=95=BD=EC=8B=9C=20application=20=EC=95=88?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acceptance/usecase/RegisterEmploymentContractUseCase.java | 4 +++- .../jobis/domain/application/model/ApplicationStatus.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java index 4c2ca8ecd..6c51e7647 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java @@ -50,12 +50,14 @@ public void execute(RegisterEmploymentContractRequest request) { .year(Year.now().getValue()) .tech(request.getCodeKeywords()) .businessArea(application.getBusinessArea()) + .applicationId(application.getId()) .build(); } ).toList(); commandAcceptancePort.saveAllAcceptance(acceptances); - commandApplicationPort.deleteApplicationByIds( + commandApplicationPort.changeApplicationStatus( + ApplicationStatus.ACCEPTANCE, applications.stream().map(ApplicationDetailVO::getId).toList() ); } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/model/ApplicationStatus.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/model/ApplicationStatus.java index 5670639a5..930402f77 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/model/ApplicationStatus.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/model/ApplicationStatus.java @@ -8,7 +8,8 @@ public enum ApplicationStatus { APPROVED, // 승인 FAILED, // 탈락 PASS, // 통과 - FIELD_TRAIN, // 현장실습, + FIELD_TRAIN, // 현장실습 + ACCEPTANCE, // 근로계약 REJECTED; // 거부 public static final List DUPLICATE_CHECK = List.of(APPROVED, PASS, FIELD_TRAIN); From 60256c9820af67f22f639a4a0426a8544f08ce8d Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sat, 18 Nov 2023 23:38:03 +0900 Subject: [PATCH 21/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#457)=20=EB=AA=A8?= =?UTF-8?q?=EC=A7=91=EC=9D=98=EB=A2=B0=EC=84=9C=20=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=EC=8B=9C=20=EA=B2=A8=EC=9A=B8=EC=9D=B8=ED=84=B4=20=EC=97=AC?= =?UTF-8?q?=EB=B6=80=20=EB=B0=9B=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/dto/request/ApplyRecruitmentRequest.java | 2 ++ .../domain/recruitment/usecase/ApplyRecruitmentUseCase.java | 1 + .../presentation/dto/request/ApplyRecruitmentWebRequest.java | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/request/ApplyRecruitmentRequest.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/request/ApplyRecruitmentRequest.java index e98f35128..de6d56541 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/request/ApplyRecruitmentRequest.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/request/ApplyRecruitmentRequest.java @@ -40,5 +40,7 @@ public class ApplyRecruitmentRequest { private LocalDate endDate; + private boolean winterIntern; + private String etc; } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/ApplyRecruitmentUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/ApplyRecruitmentUseCase.java index e44f05319..c47fd9c19 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/ApplyRecruitmentUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/ApplyRecruitmentUseCase.java @@ -45,6 +45,7 @@ public void execute(ApplyRecruitmentRequest request) { .benefits(request.getBenefits()) .etc(request.getEtc()) .hiringProgress(request.getHiringProgress()) + .winterIntern(request.isWinterIntern()) .build() ); diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/dto/request/ApplyRecruitmentWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/dto/request/ApplyRecruitmentWebRequest.java index f47ee5b15..041a01ba1 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/dto/request/ApplyRecruitmentWebRequest.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/dto/request/ApplyRecruitmentWebRequest.java @@ -58,6 +58,9 @@ public class ApplyRecruitmentWebRequest { @NotNull private LocalDate endDate; + @NotNull + private boolean winterIntern; + @Size(max = 350) private String etc; @@ -80,6 +83,7 @@ public ApplyRecruitmentRequest toDomainRequest() { .submitDocument(this.submitDocument) .startDate(this.startDate) .endDate(this.endDate) + .winterIntern(this.winterIntern) .etc(this.etc) .build(); } From b5e54ccbb7159c5b916f50342068b3bdfd574c53 Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sat, 18 Nov 2023 23:39:47 +0900 Subject: [PATCH 22/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#457)=20=EA=B2=A8?= =?UTF-8?q?=EC=9A=B8=EC=9D=B8=ED=84=B4=20=ED=95=84=ED=84=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/dto/RecruitmentFilter.java | 2 ++ .../StudentQueryRecruitmentsUseCase.java | 7 +++++-- .../TeacherQueryRecruitmentsUseCase.java | 6 ++++-- .../RecruitmentPersistenceAdapter.java | 11 ++++++++-- .../presentation/RecruitmentWebAdapter.java | 20 +++++++++++-------- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java index 4de437d55..60a45f471 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java @@ -29,6 +29,8 @@ public class RecruitmentFilter { private final Long jobCode; + private final Boolean winterIntern; + @Builder.Default private int limit = 11; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java index 10696c8b1..9818ed4d0 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java @@ -27,7 +27,8 @@ public StudentQueryRecruitmentsResponse execute( String name, Long page, Long jobCode, - List codeIds + List codeIds, + Boolean winterIntern ) { Long currentStudentId = securityPort.getCurrentUserId(); RecruitmentFilter recruitmentFilter = RecruitmentFilter.builder() @@ -39,6 +40,7 @@ public StudentQueryRecruitmentsResponse execute( .codes(codeIds) .studentId(currentStudentId) .jobCode(jobCode) + .winterIntern(winterIntern) .build(); List recruitments = @@ -59,7 +61,7 @@ public StudentQueryRecruitmentsResponse execute( return new StudentQueryRecruitmentsResponse(recruitments); } - public TotalPageCountResponse getTotalPageCount(String name, Long jobCode, List codeIds) { + public TotalPageCountResponse getTotalPageCount(String name, Long jobCode, List codeIds, Boolean winterIntern) { Long currentStudentId = securityPort.getCurrentUserId(); RecruitmentFilter filter = RecruitmentFilter.builder() @@ -70,6 +72,7 @@ public TotalPageCountResponse getTotalPageCount(String name, Long jobCode, List< .codes(codeIds) .studentId(currentStudentId) .jobCode(jobCode) + .winterIntern(winterIntern) .build(); int totalPageCount = NumberUtil.getTotalPageCount( diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java index 6f720bdfc..bd2a16e0e 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java @@ -22,7 +22,7 @@ public class TeacherQueryRecruitmentsUseCase { private final GetKeywordsService getKeywordsService; public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate start, LocalDate end, - Integer year, RecruitStatus status, Long page) { + Integer year, RecruitStatus status, Long page, Boolean winterIntern) { RecruitmentFilter filter = RecruitmentFilter.builder() .companyName(companyName) .status(status) @@ -31,6 +31,7 @@ public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate st .codes(List.of()) .year(year) .page(page) + .winterIntern(winterIntern) .build(); List recruitments = @@ -56,7 +57,7 @@ public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate st } public TotalPageCountResponse getTotalPageCount(String companyName, LocalDate start, LocalDate end, - Integer year, RecruitStatus status) { + Integer year, RecruitStatus status, Boolean winterIntern) { RecruitmentFilter filter = RecruitmentFilter.builder() .companyName(companyName) .status(status) @@ -64,6 +65,7 @@ public TotalPageCountResponse getTotalPageCount(String companyName, LocalDate st .endDate(end) .codes(List.of()) .year(year) + .winterIntern(winterIntern) .build(); int totalPageCount = NumberUtil.getTotalPageCount( diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java index 5cdb27498..177e746d9 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java @@ -91,7 +91,8 @@ public List queryRecruitmentsByFilter(RecruitmentFilter filter) { eqRecruitStatus(filter.getStatus()), containsName(filter.getCompanyName()), containsCodes(filter.getCodes()), - containsJobCode(filter.getJobCode()) + containsJobCode(filter.getJobCode()), + eqWinterIntern(filter.getWinterIntern()) ) .offset(filter.getOffset()) .limit(filter.getLimit()) @@ -145,7 +146,8 @@ public Long getRecruitmentCountByFilter(RecruitmentFilter filter) { eqRecruitStatus(filter.getStatus()), containsName(filter.getCompanyName()), containsCodes(filter.getCodes()), - containsJobCode(filter.getJobCode()) + containsJobCode(filter.getJobCode()), + eqWinterIntern(filter.getWinterIntern()) ).fetchOne(); } @@ -308,4 +310,9 @@ private BooleanExpression eqStudentId(Long studentId) { private BooleanExpression containsJobCode(Long jobCode) { return jobCode == null ? null : Expressions.stringTemplate("cast({0} as string)", recruitAreaEntity.jobCodes).contains(jobCode.toString()); } + + private BooleanExpression eqWinterIntern(Boolean winterIntern) { + return winterIntern == null ? null : recruitmentEntity.winterIntern.eq(winterIntern); + } + } \ No newline at end of file diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java index 10b2cc610..7bb39373c 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java @@ -97,20 +97,22 @@ public StudentQueryRecruitmentsResponse studentQueryRecruitments( @RequestParam(value = "name", required = false) String companyName, @RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page, @RequestParam(value = "job_code", required = false) Long jobCode, - @RequestParam(value = "tech_code", required = false) String techCode + @RequestParam(value = "tech_code", required = false) String techCode, + @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { List techCodes = StringUtil.divideString(techCode, ",").stream().map(Long::parseLong).toList(); - return studentQueryRecruitmentsUseCase.execute(companyName, page - 1, jobCode, techCodes); + return studentQueryRecruitmentsUseCase.execute(companyName, page - 1, jobCode, techCodes, winterIntern); } @GetMapping("/student/count") public TotalPageCountResponse studentQueryRecruitmentCount( @RequestParam(value = "name", required = false) String companyName, @RequestParam(value = "job_code", required = false) Long jobCode, - @RequestParam(value = "tech_code", required = false) String techCode + @RequestParam(value = "tech_code", required = false) String techCode, + @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { List techCodes = StringUtil.divideString(techCode, ",").stream().map(Long::parseLong).toList(); - return studentQueryRecruitmentsUseCase.getTotalPageCount(companyName, jobCode, techCodes); + return studentQueryRecruitmentsUseCase.getTotalPageCount(companyName, jobCode, techCodes, winterIntern); } @GetMapping("/teacher") @@ -120,9 +122,10 @@ public TeacherQueryRecruitmentsResponse queryRecruitmentList( @RequestParam(value = "end", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate end, @RequestParam(value = "status", required = false) RecruitStatus status, @RequestParam(value = "year", required = false) Integer year, - @RequestParam(value = "page", defaultValue = "1") @Positive Long page + @RequestParam(value = "page", defaultValue = "1") @Positive Long page, + @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { - return teacherQueryRecruitmentsUseCase.execute(companyName, start, end, year, status, page - 1); + return teacherQueryRecruitmentsUseCase.execute(companyName, start, end, year, status, page - 1, winterIntern); } @GetMapping("/teacher/count") @@ -131,9 +134,10 @@ public TotalPageCountResponse queryRecruitmentCount( @RequestParam(value = "start", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate start, @RequestParam(value = "end", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate end, @RequestParam(value = "status", required = false) RecruitStatus status, - @RequestParam(value = "year", required = false) Integer year + @RequestParam(value = "year", required = false) Integer year, + @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { - return teacherQueryRecruitmentsUseCase.getTotalPageCount(companyName, start, end, year, status); + return teacherQueryRecruitmentsUseCase.getTotalPageCount(companyName, start, end, year, status, winterIntern); } @ResponseStatus(HttpStatus.NO_CONTENT) From 69cb0ea6810cf49f54db840576f3e01efde6d348 Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sun, 19 Nov 2023 01:22:58 +0900 Subject: [PATCH 23/45] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#458)=20=EA=B7=BC?= =?UTF-8?q?=EB=A1=9C=EA=B3=84=EC=95=BD=20student=20=EC=A1=B0=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/acceptance/model/Acceptance.java | 6 +- .../acceptance/spi/QueryAcceptancePort.java | 3 +- .../acceptance/spi/vo/AcceptanceVO.java | 18 ++++++ .../RegisterEmploymentContractUseCase.java | 10 +--- ...ieldTraineesAndContractWorkersUseCase.java | 55 ++++++++++--------- .../spi/vo/ApplicationDetailVO.java | 8 +-- .../jobis/domain/student/model/Student.java | 31 ++++++++++- .../student/usecase/StudentSignUpUseCase.java | 16 ------ .../AcceptancePersistenceAdapter.java | 31 +++++++++-- .../persistence/entity/AcceptanceEntity.java | 10 ++-- .../persistence/mapper/AcceptanceMapper.java | 14 ++--- .../repository/vo/QueryAcceptanceVO.java | 16 ++++++ .../vo/QueryApplicationDetailVO.java | 16 ------ .../ApplicationPersistenceAdapter.java | 7 +-- .../vo/QueryApplicationDetailVO.java | 15 +++++ .../src/main/resources/application.yml | 2 +- 16 files changed, 153 insertions(+), 105 deletions(-) create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/vo/AcceptanceVO.java create mode 100644 jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryAcceptanceVO.java delete mode 100644 jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryApplicationDetailVO.java create mode 100644 jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/vo/QueryApplicationDetailVO.java diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java index 9ee2d7cbf..0d4e9ee24 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/model/Acceptance.java @@ -16,17 +16,13 @@ public class Acceptance { private final Integer year; - private final String studentName; - private final String businessArea; private final List tech; - private final String studentGcn; - private final LocalDate contractDate; private final Long companyId; - private final Long applicationId; + private final Long studentId; } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java index 277c441c4..4fb4828b6 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java @@ -1,11 +1,12 @@ package team.retum.jobis.domain.acceptance.spi; import team.retum.jobis.domain.acceptance.model.Acceptance; +import team.retum.jobis.domain.acceptance.spi.vo.AcceptanceVO; import java.util.List; public interface QueryAcceptancePort { - List queryAcceptancesByCompanyIdAndYear(Long companyId, Integer year); + List queryAcceptancesByCompanyIdAndYear(Long companyId, Integer year); } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/vo/AcceptanceVO.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/vo/AcceptanceVO.java new file mode 100644 index 000000000..70984754d --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/vo/AcceptanceVO.java @@ -0,0 +1,18 @@ +package team.retum.jobis.domain.acceptance.spi.vo; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.time.LocalDate; + +@Getter +@AllArgsConstructor +public class AcceptanceVO { + + private final Long acceptanceId; + private final Integer grade; + private final Integer classRoom; + private final Integer number; + private final String studentName; + private final LocalDate contractDate; +} diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java index 6c51e7647..9673d8f80 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java @@ -39,18 +39,12 @@ public void execute(RegisterEmploymentContractRequest request) { } return Acceptance.builder() - .studentName(application.getStudentName()) - .companyId(application.getId()) - .studentGcn(Student.processGcn( - application.getStudentGrade(), - application.getStudentClassNumber(), - application.getStudentNumber() - )) + .companyId(application.getCompanyId()) .contractDate(LocalDate.now()) .year(Year.now().getValue()) .tech(request.getCodeKeywords()) .businessArea(application.getBusinessArea()) - .applicationId(application.getId()) + .studentId(application.getStudentId()) .build(); } ).toList(); diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java index a45d4b67e..869148ecb 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java @@ -7,6 +7,7 @@ import team.retum.jobis.domain.acceptance.dto.response.TeacherQueryFieldTraineesAndContractWorkersResponse.TeacherQueryFieldTraineesResponse; import team.retum.jobis.domain.acceptance.model.Acceptance; import team.retum.jobis.domain.acceptance.spi.QueryAcceptancePort; +import team.retum.jobis.domain.acceptance.spi.vo.AcceptanceVO; import team.retum.jobis.domain.application.spi.QueryApplicationPort; import team.retum.jobis.domain.application.spi.vo.FieldTraineesVO; import team.retum.jobis.domain.student.model.Student; @@ -22,54 +23,54 @@ public class TeacherQueryFieldTraineesAndContractWorkersUseCase { private final QueryAcceptancePort queryAcceptancePort; public TeacherQueryFieldTraineesAndContractWorkersResponse execute(Long companyId) { - - List queryFieldTraineesVOs = - queryApplicationPort.queryApplicationsFieldTraineesByCompanyId(companyId); - - List acceptanceEntities = - queryAcceptancePort.queryAcceptancesByCompanyIdAndYear(companyId, Year.now().getValue()); + List fieldTrainees = queryApplicationPort.queryApplicationsFieldTraineesByCompanyId(companyId); + List acceptances = queryAcceptancePort.queryAcceptancesByCompanyIdAndYear(companyId, Year.now().getValue()); return new TeacherQueryFieldTraineesAndContractWorkersResponse( - buildFieldTrainees(queryFieldTraineesVOs), - buildContractWorkers(acceptanceEntities) + buildFieldTrainees(fieldTrainees), + buildContractWorkers(acceptances) ); } private List buildFieldTrainees( - List queryFieldTraineesVOs + List fieldTrainees ) { - return queryFieldTraineesVOs.stream() - .map(vo -> TeacherQueryFieldTraineesResponse + return fieldTrainees.stream() + .map( + fieldTrainee -> TeacherQueryFieldTraineesResponse .builder() - .applicationId(vo.getApplicationId()) + .applicationId(fieldTrainee.getApplicationId()) .studentGcn( Student.processGcn( - vo.getGrade(), - vo.getClassRoom(), - vo.getNumber() + fieldTrainee.getGrade(), + fieldTrainee.getClassRoom(), + fieldTrainee.getNumber() ) ) - .studentName(vo.getStudentName()) - .startDate(vo.getStartDate()) - .endDate(vo.getEndDate()) - .build()) - .toList(); + .studentName(fieldTrainee.getStudentName()) + .startDate(fieldTrainee.getStartDate()) + .endDate(fieldTrainee.getEndDate()) + .build() + ).toList(); } private List buildContractWorkers( - List acceptanceEntities + List acceptances ) { - return acceptanceEntities - .stream() + return acceptances.stream() .map( acceptance -> TeacherQueryContractWorkersResponse .builder() - .acceptanceId(acceptance.getId()) - .studentGcn(acceptance.getStudentGcn()) + .acceptanceId(acceptance.getAcceptanceId()) + .studentGcn( + Student.processGcn( + acceptance.getGrade(), + acceptance.getClassRoom(), + acceptance.getNumber() + )) .studentName(acceptance.getStudentName()) .contractDate(acceptance.getContractDate()) .build() - ) - .toList(); + ).toList(); } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/vo/ApplicationDetailVO.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/vo/ApplicationDetailVO.java index 6a2bfc33a..f8012e064 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/vo/ApplicationDetailVO.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/vo/ApplicationDetailVO.java @@ -10,13 +10,7 @@ public class ApplicationDetailVO { private final Long id; - private final String studentName; - - private final int studentGrade; - - private final int studentClassNumber; - - private final int studentNumber; + private final Long studentId; private final Long companyId; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java index 30b5e3f48..27e5f891b 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java @@ -6,10 +6,10 @@ import team.retum.jobis.domain.application.exception.InvalidGradeException; import team.retum.jobis.domain.student.exception.ClassRoomNotFoundException; +import java.time.Period; import java.time.Year; @Getter -@Builder(toBuilder = true) @Aggregate public class Student { @@ -31,6 +31,20 @@ public class Student { private final Year entranceYear; + @Builder(toBuilder = true) + public Student(Long id, String name, Integer grade, Integer classRoom, Integer number, Gender gender, + Department department, String profileImageUrl, Year entranceYear) { + this.id = id; + this.name = name; + this.grade = grade; + this.classRoom = classRoom; + this.number = number; + this.gender = gender; + this.department = department; + this.profileImageUrl = profileImageUrl; + this.entranceYear = entranceYear == null ? getEntranceYear(grade) : entranceYear; + } + public static String processGcn(int grade, int classNumber, int number) { return String.valueOf(grade) + classNumber + @@ -55,4 +69,19 @@ public Student changeStudentProfile(String profileImageUrl) { .profileImageUrl(profileImageUrl) .build(); } + + private Year getEntranceYear(Integer grade) { + Year year = Year.now(); + switch (grade) { + case 2 -> { + return year.minus(Period.ofYears(1)); + } + case 3 -> { + return year.minus(Period.ofYears(2)); + } + default -> { + return year; + } + } + } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java index 8898ed223..a2cf08bb0 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java @@ -71,7 +71,6 @@ public TokenResponse execute(StudentSignUpRequest request) { ) ) .profileImageUrl(request.getProfileImageUrl()) - .entranceYear(getEntranceYear(request.getGrade())) .build() ); @@ -86,19 +85,4 @@ public TokenResponse execute(StudentSignUpRequest request) { return jwtPort.generateTokens(userEntity.getId(), userEntity.getAuthority()); } - - private Year getEntranceYear(Integer grade) { - Year year = Year.now(); - switch (grade) { - case 2 -> { - return year.minus(Period.ofYears(1)); - } - case 3 -> { - return year.minus(Period.ofYears(2)); - } - default -> { - return year; - } - } - } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java index 5109868a2..90bd48060 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java @@ -6,12 +6,17 @@ import team.retum.jobis.domain.acceptance.model.Acceptance; import team.retum.jobis.domain.acceptance.persistence.mapper.AcceptanceMapper; import team.retum.jobis.domain.acceptance.persistence.repository.AcceptanceJpaRepository; +import team.retum.jobis.domain.acceptance.persistence.repository.vo.QQueryAcceptanceVO; import team.retum.jobis.domain.acceptance.spi.AcceptancePort; +import team.retum.jobis.domain.acceptance.spi.vo.AcceptanceVO; +import team.retum.jobis.domain.application.spi.vo.ApplicationDetailVO; import java.time.LocalDate; import java.util.List; import static team.retum.jobis.domain.acceptance.persistence.entity.QAcceptanceEntity.acceptanceEntity; +import static team.retum.jobis.domain.company.persistence.entity.QCompanyEntity.companyEntity; +import static team.retum.jobis.domain.student.persistence.entity.QStudentEntity.studentEntity; @RequiredArgsConstructor @Repository @@ -19,18 +24,34 @@ public class AcceptancePersistenceAdapter implements AcceptancePort { private final AcceptanceJpaRepository acceptanceJpaRepository; private final AcceptanceMapper acceptanceMapper; - private final JPAQueryFactory jpaQueryFactory; + private final JPAQueryFactory queryFactory; @Override - public List queryAcceptancesByCompanyIdAndYear(Long companyId, Integer year) { - return acceptanceJpaRepository.findByCompanyIdAndYear(companyId, year).stream() - .map(acceptanceMapper::toDomain) + public List queryAcceptancesByCompanyIdAndYear(Long companyId, Integer year) { + return queryFactory + .select( + new QQueryAcceptanceVO( + acceptanceEntity.id, + studentEntity.grade, + studentEntity.classRoom, + studentEntity.number, + studentEntity.name, + acceptanceEntity.contractDate + ) + ) + .from(acceptanceEntity) + .join(acceptanceEntity.student, studentEntity) + .where( + acceptanceEntity.company.id.eq(companyId), + acceptanceEntity.year.eq(year) + ).fetch().stream() + .map(AcceptanceVO.class::cast) .toList(); } @Override public void updateContractDate(LocalDate contractDate, List acceptanceIds) { - jpaQueryFactory + queryFactory .update(acceptanceEntity) .set(acceptanceEntity.contractDate, contractDate) .where(acceptanceEntity.id.in(acceptanceIds)) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java index e70867fd8..306a1f398 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/entity/AcceptanceEntity.java @@ -4,8 +4,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import team.retum.jobis.domain.application.persistence.entity.ApplicationEntity; import team.retum.jobis.domain.company.persistence.entity.CompanyEntity; +import team.retum.jobis.domain.student.persistence.entity.StudentEntity; import team.retum.jobis.global.converter.StringListConverter; import javax.persistence.Column; @@ -62,12 +62,12 @@ public class AcceptanceEntity { private CompanyEntity company; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "application_id", nullable = false) - private ApplicationEntity application; + @JoinColumn(name = "student_id", nullable = false) + private StudentEntity student; @Builder public AcceptanceEntity(Long id, Integer year, String studentName, String businessArea, List tech, - String studentGcn, LocalDate contractDate, CompanyEntity companyEntity, ApplicationEntity application) { + String studentGcn, LocalDate contractDate, CompanyEntity companyEntity, StudentEntity student) { this.id = id; this.year = year; this.studentName = studentName; @@ -76,6 +76,6 @@ public AcceptanceEntity(Long id, Integer year, String studentName, String busine this.studentGcn = studentGcn; this.contractDate = contractDate; this.company = companyEntity; - this.application = application; + this.student = student; } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java index 6bd648a84..586b00d5a 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java @@ -10,18 +10,20 @@ import team.retum.jobis.domain.company.exception.CompanyNotFoundException; import team.retum.jobis.domain.company.persistence.entity.CompanyEntity; import team.retum.jobis.domain.company.persistence.repository.CompanyJpaRepository; +import team.retum.jobis.domain.student.persistence.entity.StudentEntity; +import team.retum.jobis.domain.student.persistence.repository.StudentJpaRepository; @RequiredArgsConstructor @Component public class AcceptanceMapper { private final CompanyJpaRepository companyJpaRepository; - private final ApplicationJpaRepository applicationJpaRepository; + private final StudentJpaRepository studentJpaRepository; public AcceptanceEntity toEntity(Acceptance domain) { CompanyEntity company = companyJpaRepository.findById(domain.getCompanyId()) .orElseThrow(() -> CompanyNotFoundException.EXCEPTION); - ApplicationEntity application = applicationJpaRepository.findById(domain.getApplicationId()) + StudentEntity student = studentJpaRepository.findById(domain.getStudentId()) .orElseThrow(() -> ApplicationNotFoundException.EXCEPTION); return AcceptanceEntity.builder() @@ -30,10 +32,8 @@ public AcceptanceEntity toEntity(Acceptance domain) { .contractDate(domain.getContractDate()) .businessArea(domain.getBusinessArea()) .year(domain.getYear()) - .studentName(domain.getStudentName()) - .studentGcn(domain.getStudentGcn()) .tech(domain.getTech()) - .application(application) + .student(student) .build(); } @@ -42,11 +42,9 @@ public Acceptance toDomain(AcceptanceEntity entity) { .contractDate(entity.getContractDate()) .businessArea(entity.getBusinessArea()) .tech(entity.getTech()) - .studentName(entity.getStudentName()) - .studentGcn(entity.getStudentGcn()) .id(entity.getId()) .companyId(entity.getCompany().getId()) - .applicationId(entity.getApplication().getId()) + .studentId(entity.getStudent().getId()) .build(); } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryAcceptanceVO.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryAcceptanceVO.java new file mode 100644 index 000000000..9d3a6b00a --- /dev/null +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryAcceptanceVO.java @@ -0,0 +1,16 @@ +package team.retum.jobis.domain.acceptance.persistence.repository.vo; + +import com.querydsl.core.annotations.QueryProjection; +import lombok.Getter; +import team.retum.jobis.domain.acceptance.spi.vo.AcceptanceVO; + +import java.time.LocalDate; + +@Getter +public class QueryAcceptanceVO extends AcceptanceVO { + + @QueryProjection + public QueryAcceptanceVO(Long acceptanceId, Integer grade, Integer classRoom, Integer number, String studentName, LocalDate contractDate) { + super(acceptanceId, grade, classRoom, number, studentName, contractDate); + } +} diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryApplicationDetailVO.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryApplicationDetailVO.java deleted file mode 100644 index 6335c9a1e..000000000 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/repository/vo/QueryApplicationDetailVO.java +++ /dev/null @@ -1,16 +0,0 @@ -package team.retum.jobis.domain.acceptance.persistence.repository.vo; - -import com.querydsl.core.annotations.QueryProjection; -import lombok.Getter; -import team.retum.jobis.domain.application.model.ApplicationStatus; -import team.retum.jobis.domain.application.spi.vo.ApplicationDetailVO; - -@Getter -public class QueryApplicationDetailVO extends ApplicationDetailVO { - - @QueryProjection - public QueryApplicationDetailVO(Long id, String studentName, int studentGrade, int studentClassNumber, - int studentNumber, Long companyId, String businessArea, ApplicationStatus status) { - super(id, studentName, studentGrade, studentClassNumber, studentNumber, companyId, businessArea, status); - } -} diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java index e75e49318..fdf265494 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java @@ -4,12 +4,12 @@ import com.querydsl.jpa.impl.JPAQueryFactory; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; -import team.retum.jobis.domain.acceptance.persistence.repository.vo.QQueryApplicationDetailVO; import team.retum.jobis.domain.application.model.Application; import team.retum.jobis.domain.application.model.ApplicationAttachment; import team.retum.jobis.domain.application.model.ApplicationStatus; import team.retum.jobis.domain.application.persistence.mapper.ApplicationMapper; import team.retum.jobis.domain.application.persistence.repository.ApplicationJpaRepository; +import team.retum.jobis.domain.application.persistence.repository.vo.QQueryApplicationDetailVO; import team.retum.jobis.domain.application.persistence.repository.vo.QQueryApplicationVO; import team.retum.jobis.domain.application.persistence.repository.vo.QQueryFieldTraineesVO; import team.retum.jobis.domain.application.persistence.repository.vo.QQueryPassedApplicationStudentsVO; @@ -211,10 +211,7 @@ public List queryApplicationDetailsByIds(List applica .select( new QQueryApplicationDetailVO( applicationEntity.id, - studentEntity.name, - studentEntity.grade, - studentEntity.classRoom, - studentEntity.number, + studentEntity.id, companyEntity.id, companyEntity.businessArea, applicationEntity.applicationStatus diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/vo/QueryApplicationDetailVO.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/vo/QueryApplicationDetailVO.java new file mode 100644 index 000000000..cfca86c6d --- /dev/null +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/vo/QueryApplicationDetailVO.java @@ -0,0 +1,15 @@ +package team.retum.jobis.domain.application.persistence.repository.vo; + +import com.querydsl.core.annotations.QueryProjection; +import lombok.Getter; +import team.retum.jobis.domain.application.model.ApplicationStatus; +import team.retum.jobis.domain.application.spi.vo.ApplicationDetailVO; + +@Getter +public class QueryApplicationDetailVO extends ApplicationDetailVO { + + @QueryProjection + public QueryApplicationDetailVO(Long id, Long studentId, Long companyId, String businessArea, ApplicationStatus status) { + super(id, studentId, companyId, businessArea, status); + } +} diff --git a/jobis-infrastructure/src/main/resources/application.yml b/jobis-infrastructure/src/main/resources/application.yml index 5555785ab..00d3d6ab8 100644 --- a/jobis-infrastructure/src/main/resources/application.yml +++ b/jobis-infrastructure/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: jpa: database-platform: team.retum.jobis.global.config.MysqlDialectConfig hibernate: - ddl-auto: + ddl-auto: update properties.hibernate: format_sql: true show_sql: ${SHOW_SQL:true} From 62e1b92a64bae96221beccd297e104f9e63427f4 Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sun, 19 Nov 2023 13:00:48 +0900 Subject: [PATCH 24/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#458)=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acceptance/spi/QueryAcceptancePort.java | 1 - .../RegisterEmploymentContractUseCase.java | 1 - ...ieldTraineesAndContractWorkersUseCase.java | 33 +++++++++---------- .../service/SaveRecruitmentAreaService.java | 1 - .../jobis/domain/student/model/Student.java | 1 - .../student/usecase/StudentSignUpUseCase.java | 3 -- .../AcceptancePersistenceAdapter.java | 2 -- .../persistence/mapper/AcceptanceMapper.java | 2 -- 8 files changed, 16 insertions(+), 28 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java index 4fb4828b6..3dbc2389a 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/spi/QueryAcceptancePort.java @@ -1,6 +1,5 @@ package team.retum.jobis.domain.acceptance.spi; -import team.retum.jobis.domain.acceptance.model.Acceptance; import team.retum.jobis.domain.acceptance.spi.vo.AcceptanceVO; import java.util.List; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java index 9673d8f80..922c670b8 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/RegisterEmploymentContractUseCase.java @@ -11,7 +11,6 @@ import team.retum.jobis.domain.application.spi.CommandApplicationPort; import team.retum.jobis.domain.application.spi.QueryApplicationPort; import team.retum.jobis.domain.application.spi.vo.ApplicationDetailVO; -import team.retum.jobis.domain.student.model.Student; import java.time.LocalDate; import java.time.Year; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java index 869148ecb..e4006f30f 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/acceptance/usecase/TeacherQueryFieldTraineesAndContractWorkersUseCase.java @@ -5,7 +5,6 @@ import team.retum.jobis.domain.acceptance.dto.response.TeacherQueryFieldTraineesAndContractWorkersResponse; import team.retum.jobis.domain.acceptance.dto.response.TeacherQueryFieldTraineesAndContractWorkersResponse.TeacherQueryContractWorkersResponse; import team.retum.jobis.domain.acceptance.dto.response.TeacherQueryFieldTraineesAndContractWorkersResponse.TeacherQueryFieldTraineesResponse; -import team.retum.jobis.domain.acceptance.model.Acceptance; import team.retum.jobis.domain.acceptance.spi.QueryAcceptancePort; import team.retum.jobis.domain.acceptance.spi.vo.AcceptanceVO; import team.retum.jobis.domain.application.spi.QueryApplicationPort; @@ -38,19 +37,19 @@ private List buildFieldTrainees( return fieldTrainees.stream() .map( fieldTrainee -> TeacherQueryFieldTraineesResponse - .builder() - .applicationId(fieldTrainee.getApplicationId()) - .studentGcn( - Student.processGcn( - fieldTrainee.getGrade(), - fieldTrainee.getClassRoom(), - fieldTrainee.getNumber() + .builder() + .applicationId(fieldTrainee.getApplicationId()) + .studentGcn( + Student.processGcn( + fieldTrainee.getGrade(), + fieldTrainee.getClassRoom(), + fieldTrainee.getNumber() + ) ) - ) - .studentName(fieldTrainee.getStudentName()) - .startDate(fieldTrainee.getStartDate()) - .endDate(fieldTrainee.getEndDate()) - .build() + .studentName(fieldTrainee.getStudentName()) + .startDate(fieldTrainee.getStartDate()) + .endDate(fieldTrainee.getEndDate()) + .build() ).toList(); } @@ -64,10 +63,10 @@ private List buildContractWorkers( .acceptanceId(acceptance.getAcceptanceId()) .studentGcn( Student.processGcn( - acceptance.getGrade(), - acceptance.getClassRoom(), - acceptance.getNumber() - )) + acceptance.getGrade(), + acceptance.getClassRoom(), + acceptance.getNumber() + )) .studentName(acceptance.getStudentName()) .contractDate(acceptance.getContractDate()) .build() diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java index 10bedd706..2985e91b7 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java @@ -3,7 +3,6 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.Service; import team.retum.jobis.domain.code.model.RecruitAreaCode; -import team.retum.jobis.domain.code.spi.QueryCodePort; import team.retum.jobis.domain.recruitment.dto.request.CreateRecruitAreaRequest; import team.retum.jobis.domain.recruitment.model.RecruitArea; import team.retum.jobis.domain.recruitment.spi.CommandRecruitmentPort; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java index 27e5f891b..a642f28e4 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java @@ -3,7 +3,6 @@ import lombok.Builder; import lombok.Getter; import team.retum.jobis.common.annotation.Aggregate; -import team.retum.jobis.domain.application.exception.InvalidGradeException; import team.retum.jobis.domain.student.exception.ClassRoomNotFoundException; import java.time.Period; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java index a2cf08bb0..72c3d8610 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/usecase/StudentSignUpUseCase.java @@ -18,9 +18,6 @@ import team.retum.jobis.domain.user.spi.CommandUserPort; import team.retum.jobis.domain.user.spi.QueryUserPort; -import java.time.Period; -import java.time.Year; - @RequiredArgsConstructor @UseCase public class StudentSignUpUseCase { diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java index 90bd48060..bf3bc2dc5 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/AcceptancePersistenceAdapter.java @@ -9,13 +9,11 @@ import team.retum.jobis.domain.acceptance.persistence.repository.vo.QQueryAcceptanceVO; import team.retum.jobis.domain.acceptance.spi.AcceptancePort; import team.retum.jobis.domain.acceptance.spi.vo.AcceptanceVO; -import team.retum.jobis.domain.application.spi.vo.ApplicationDetailVO; import java.time.LocalDate; import java.util.List; import static team.retum.jobis.domain.acceptance.persistence.entity.QAcceptanceEntity.acceptanceEntity; -import static team.retum.jobis.domain.company.persistence.entity.QCompanyEntity.companyEntity; import static team.retum.jobis.domain.student.persistence.entity.QStudentEntity.studentEntity; @RequiredArgsConstructor diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java index 586b00d5a..f023d2f0a 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java @@ -5,8 +5,6 @@ import team.retum.jobis.domain.acceptance.model.Acceptance; import team.retum.jobis.domain.acceptance.persistence.entity.AcceptanceEntity; import team.retum.jobis.domain.application.exception.ApplicationNotFoundException; -import team.retum.jobis.domain.application.persistence.entity.ApplicationEntity; -import team.retum.jobis.domain.application.persistence.repository.ApplicationJpaRepository; import team.retum.jobis.domain.company.exception.CompanyNotFoundException; import team.retum.jobis.domain.company.persistence.entity.CompanyEntity; import team.retum.jobis.domain.company.persistence.repository.CompanyJpaRepository; From 8fc8ef150e7233724308baf27b329723dbcbd8db Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sun, 19 Nov 2023 23:11:11 +0900 Subject: [PATCH 25/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#458)=20=EC=BD=94?= =?UTF-8?q?=EB=A9=98=ED=8A=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/acceptance/persistence/mapper/AcceptanceMapper.java | 3 ++- jobis-infrastructure/src/main/resources/application.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java index f023d2f0a..c71da954b 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java @@ -8,6 +8,7 @@ import team.retum.jobis.domain.company.exception.CompanyNotFoundException; import team.retum.jobis.domain.company.persistence.entity.CompanyEntity; import team.retum.jobis.domain.company.persistence.repository.CompanyJpaRepository; +import team.retum.jobis.domain.student.exception.StudentNotFoundException; import team.retum.jobis.domain.student.persistence.entity.StudentEntity; import team.retum.jobis.domain.student.persistence.repository.StudentJpaRepository; @@ -22,7 +23,7 @@ public AcceptanceEntity toEntity(Acceptance domain) { CompanyEntity company = companyJpaRepository.findById(domain.getCompanyId()) .orElseThrow(() -> CompanyNotFoundException.EXCEPTION); StudentEntity student = studentJpaRepository.findById(domain.getStudentId()) - .orElseThrow(() -> ApplicationNotFoundException.EXCEPTION); + .orElseThrow(() -> StudentNotFoundException.EXCEPTION); return AcceptanceEntity.builder() .id(domain.getId()) diff --git a/jobis-infrastructure/src/main/resources/application.yml b/jobis-infrastructure/src/main/resources/application.yml index 00d3d6ab8..5555785ab 100644 --- a/jobis-infrastructure/src/main/resources/application.yml +++ b/jobis-infrastructure/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: jpa: database-platform: team.retum.jobis.global.config.MysqlDialectConfig hibernate: - ddl-auto: update + ddl-auto: properties.hibernate: format_sql: true show_sql: ${SHOW_SQL:true} From f9c3ba61c6716b7801850f5fea994a1c84b6536d Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sun, 19 Nov 2023 23:17:42 +0900 Subject: [PATCH 26/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#458)=20validate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jobis-infrastructure/src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobis-infrastructure/src/main/resources/application.yml b/jobis-infrastructure/src/main/resources/application.yml index 5555785ab..c4bfe2bf5 100644 --- a/jobis-infrastructure/src/main/resources/application.yml +++ b/jobis-infrastructure/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: jpa: database-platform: team.retum.jobis.global.config.MysqlDialectConfig hibernate: - ddl-auto: + ddl-auto: ${DDL:validate} properties.hibernate: format_sql: true show_sql: ${SHOW_SQL:true} From b8ef5739bbd066175ba365d556e4475cdcf4c4cd Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Sun, 19 Nov 2023 23:19:44 +0900 Subject: [PATCH 27/45] =?UTF-8?q?=F0=9F=9B=A9=EF=B8=8F=20::=20(#458)=20imp?= =?UTF-8?q?ort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/acceptance/persistence/mapper/AcceptanceMapper.java | 1 - 1 file changed, 1 deletion(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java index c71da954b..b71bfad60 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/acceptance/persistence/mapper/AcceptanceMapper.java @@ -4,7 +4,6 @@ import org.springframework.stereotype.Component; import team.retum.jobis.domain.acceptance.model.Acceptance; import team.retum.jobis.domain.acceptance.persistence.entity.AcceptanceEntity; -import team.retum.jobis.domain.application.exception.ApplicationNotFoundException; import team.retum.jobis.domain.company.exception.CompanyNotFoundException; import team.retum.jobis.domain.company.persistence.entity.CompanyEntity; import team.retum.jobis.domain.company.persistence.repository.CompanyJpaRepository; From 179a9ec3fcbefdc651abf97c06784f41d5807df8 Mon Sep 17 00:00:00 2001 From: gilgeunwoo Date: Mon, 20 Nov 2023 23:06:00 +0900 Subject: [PATCH 28/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#main)=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=ED=98=95=EC=8B=9D=20=EB=AA=BB?= =?UTF-8?q?=EB=B0=9B=EB=8A=94=20500=20=EC=97=90=EB=9F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobis/domain/student/model/Student.java | 24 +++++++------------ .../persistence/entity/StudentEntity.java | 4 ++-- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java index a642f28e4..8819e8490 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/student/model/Student.java @@ -28,11 +28,11 @@ public class Student { private final String profileImageUrl; - private final Year entranceYear; + private final Integer entranceYear; @Builder(toBuilder = true) public Student(Long id, String name, Integer grade, Integer classRoom, Integer number, Gender gender, - Department department, String profileImageUrl, Year entranceYear) { + Department department, String profileImageUrl, Integer entranceYear) { this.id = id; this.name = name; this.grade = grade; @@ -69,18 +69,12 @@ public Student changeStudentProfile(String profileImageUrl) { .build(); } - private Year getEntranceYear(Integer grade) { - Year year = Year.now(); - switch (grade) { - case 2 -> { - return year.minus(Period.ofYears(1)); - } - case 3 -> { - return year.minus(Period.ofYears(2)); - } - default -> { - return year; - } - } + private Integer getEntranceYear(Integer grade) { + int year = Year.now().getValue(); + return switch (grade) { + case 2 -> year - 1; + case 3 -> year - 2; + default -> year; + }; } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java index 7477092fe..1de57d6c3 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java @@ -86,7 +86,7 @@ public class StudentEntity { @NotNull @Column(columnDefinition = "YEAR") - private Year entranceYear; + private Integer entranceYear; @OneToMany(mappedBy = "student", orphanRemoval = true) private final List applications = new ArrayList<>(); @@ -97,7 +97,7 @@ public class StudentEntity { @Builder public StudentEntity(Long id, UserEntity userEntity, String name, Integer grade, Integer classRoom, Integer number, Gender gender, - Department department, String profileImageUrl, Year entranceYear) { + Department department, String profileImageUrl, Integer entranceYear) { this.id = id; this.userEntity = userEntity; this.name = name; From cebae31f773054c025a17b40e29ee27b836cc001 Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Mon, 20 Nov 2023 22:30:30 +0900 Subject: [PATCH 29/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#461)=20=EB=B9=84?= =?UTF-8?q?=EB=B0=80=EB=B2=88=ED=98=B8=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20?= =?UTF-8?q?=EA=B2=80=EC=82=AC=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/dto/request/RegisterCompanyWebRequest.java | 3 +-- .../dto/request/UpdateForgottenPasswordWebRequest.java | 1 - .../presentation/dto/request/UpdatePasswordWebRequest.java | 3 --- .../domain/user/presentation/dto/request/LoginWebRequest.java | 4 +++- .../main/java/team/retum/jobis/global/util/RegexProperty.java | 2 -- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/presentation/dto/request/RegisterCompanyWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/presentation/dto/request/RegisterCompanyWebRequest.java index eaec3f77e..151284cd2 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/presentation/dto/request/RegisterCompanyWebRequest.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/presentation/dto/request/RegisterCompanyWebRequest.java @@ -27,8 +27,7 @@ public class RegisterCompanyWebRequest { @Size(min = 10, max = 10) private String businessNumber; - @NotNull - @Pattern(regexp = RegexProperty.COMPANY_PASSWORD) + @Pattern(regexp = RegexProperty.PASSWORD) private String password; @NotEmpty diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdateForgottenPasswordWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdateForgottenPasswordWebRequest.java index e783b5f11..982e3f179 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdateForgottenPasswordWebRequest.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdateForgottenPasswordWebRequest.java @@ -18,7 +18,6 @@ public class UpdateForgottenPasswordWebRequest { @Pattern(regexp = RegexProperty.EMAIL) private String email; - @NotBlank @Pattern(regexp = RegexProperty.PASSWORD) private String password; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdatePasswordWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdatePasswordWebRequest.java index bcc8e8587..57a7bc789 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdatePasswordWebRequest.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/presentation/dto/request/UpdatePasswordWebRequest.java @@ -5,18 +5,15 @@ import team.retum.jobis.domain.student.dto.UpdatePasswordRequest; import team.retum.jobis.global.util.RegexProperty; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; @Getter @NoArgsConstructor public class UpdatePasswordWebRequest { - @NotBlank @Pattern(regexp = RegexProperty.PASSWORD) private String currentPassword; - @NotBlank @Pattern(regexp = RegexProperty.PASSWORD) private String newPassword; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/user/presentation/dto/request/LoginWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/user/presentation/dto/request/LoginWebRequest.java index 22318e022..cc2851f41 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/user/presentation/dto/request/LoginWebRequest.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/user/presentation/dto/request/LoginWebRequest.java @@ -3,8 +3,10 @@ import lombok.Getter; import lombok.NoArgsConstructor; import team.retum.jobis.domain.user.dto.LoginRequest; +import team.retum.jobis.global.util.RegexProperty; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; @Getter @@ -15,7 +17,7 @@ public class LoginWebRequest { @NotBlank private String accountId; - @NotBlank + @Pattern(regexp = RegexProperty.PASSWORD) private String password; public LoginRequest toDomainRequest() { diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/global/util/RegexProperty.java b/jobis-infrastructure/src/main/java/team/retum/jobis/global/util/RegexProperty.java index de6dcac5b..8b2faf66a 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/global/util/RegexProperty.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/global/util/RegexProperty.java @@ -8,6 +8,4 @@ public class RegexProperty { public static final String EMAIL = "^.+@dsm.hs.kr$"; public static final String PASSWORD = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[~!@#$%^&*()+|=])[A-Za-z\\d~!@#$%^&*()+|=]{8,16}$"; - - public static final String COMPANY_PASSWORD = "^[0-9]{4}"; } From 4a3a018c7ea38e2237c7f20b1883d75412328576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Mon, 20 Nov 2023 22:10:41 +0900 Subject: [PATCH 30/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F:=20(#448)=20=EC=9E=90?= =?UTF-8?q?=EB=A3=8C=ED=98=95=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobis/domain/student/persistence/entity/StudentEntity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java index 1de57d6c3..4cf7144de 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java @@ -26,6 +26,7 @@ import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.UniqueConstraint; +import javax.persistence.criteria.CriteriaBuilder; import javax.validation.constraints.NotNull; import java.time.Year; import java.util.ArrayList; From 89f49b6adfb0a0b89ebefaf7aa98a2ca9362605a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Mon, 20 Nov 2023 22:12:08 +0900 Subject: [PATCH 31/45] =?UTF-8?q?=E2=9A=92=EF=B8=8F=20::=20(#448)=20?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/code/model/RecruitAreaCode.java | 4 +++- .../recruitment/dto/RecruitmentFilter.java | 3 --- .../domain/recruitment/model/RecruitArea.java | 2 -- .../code/persistence/entity/CodeEntity.java | 8 ++++---- .../entity/RecruitAreaCodeEntity.java | 19 ++++++++++++++----- .../persistence/entity/RecruitAreaCodeId.java | 8 +++++++- .../code/persistence/mapper/CodeMapper.java | 6 +++--- .../mapper/RecruitAreaCodeMapper.java | 13 ++++++++++--- .../repository/CodeJpaRepository.java | 2 +- .../persistence/entity/RecruitAreaEntity.java | 10 +--------- .../persistence/mapper/RecruitAreaMapper.java | 3 --- .../converter/HiringProgressConverter.java | 2 ++ .../review/persistence/mapper/QnAMapper.java | 2 +- 13 files changed, 46 insertions(+), 36 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/code/model/RecruitAreaCode.java b/jobis-application/src/main/java/team/retum/jobis/domain/code/model/RecruitAreaCode.java index 45a8fb55b..ab97ce608 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/code/model/RecruitAreaCode.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/code/model/RecruitAreaCode.java @@ -11,6 +11,8 @@ public class RecruitAreaCode { private final Long recruitAreaId; - private final Long codeId; + private final Long code; + + private final CodeType type; } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java index 60a45f471..d9dc548ea 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/RecruitmentFilter.java @@ -27,10 +27,7 @@ public class RecruitmentFilter { private final Long studentId; - private final Long jobCode; - private final Boolean winterIntern; - @Builder.Default private int limit = 11; diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java index f9eb2144b..d93986609 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java @@ -17,8 +17,6 @@ public class RecruitArea { private final String majorTask; - private final List jobCodes; - private final String preferentialTreatment; private final Long recruitmentId; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java index 832c48156..c2b4a6a85 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java @@ -28,12 +28,12 @@ public class CodeEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + private Long code; @NotNull @Enumerated(EnumType.STRING) @Column(columnDefinition = "VARCHAR(13)") - private CodeType codeType; + private CodeType type; @Enumerated(EnumType.STRING) @Column(columnDefinition = "VARCHAR(8)") @@ -49,8 +49,8 @@ public class CodeEntity { @Builder public CodeEntity(Long id, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity) { - this.id = id; - this.codeType = codeType; + this.code = id; + this.type = codeType; this.jobType = jobType; this.keyword = keyword; this.parentCode = parentCodeEntity; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeEntity.java index 7afaa58e2..4884d2651 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeEntity.java @@ -4,32 +4,41 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; +import team.retum.jobis.domain.code.model.CodeType; import team.retum.jobis.domain.recruitment.persistence.entity.RecruitAreaEntity; +import javax.persistence.EmbeddedId; import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.MapsId; import javax.persistence.Table; @Getter @AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PROTECTED) -@IdClass(RecruitAreaCodeId.class) @Table(name = "tbl_recruit_area_code") @Entity public class RecruitAreaCodeEntity { - @Id + @EmbeddedId + private RecruitAreaCodeId recruitAreaCodeId; + + @MapsId("recruitAreaId") @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "recruit_area_id", nullable = false) private RecruitAreaEntity recruitArea; - @Id + + @MapsId("code") @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "code_id", nullable = false) private CodeEntity code; + + @Enumerated(EnumType.STRING) + private CodeType type; } \ No newline at end of file diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeId.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeId.java index 1174f485e..6440e54ea 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeId.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/RecruitAreaCodeId.java @@ -5,12 +5,18 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import javax.persistence.Column; +import javax.persistence.Embeddable; import java.io.Serializable; @AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PROTECTED) +@Embeddable @EqualsAndHashCode public class RecruitAreaCodeId implements Serializable { - private Long recruitArea; + @Column + private Long recruitAreaId; + + @Column private Long code; } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java index a131b01e8..ef042384e 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java @@ -29,11 +29,11 @@ public CodeEntity toEntity(Code domain) { public Code toDomain(CodeEntity entity) { return Code.builder() - .id(entity.getId()) - .codeType(entity.getCodeType()) + .id(entity.getCode()) + .codeType(entity.getType()) .jobType(entity.getJobType()) .keyword(entity.getKeyword()) - .parentCodeId(entity.getParentCode() == null ? null : entity.getParentCode().getId()) + .parentCodeId(entity.getParentCode() == null ? null : entity.getParentCode().getCode()) .build(); } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/RecruitAreaCodeMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/RecruitAreaCodeMapper.java index dc416a449..5f5fe4f63 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/RecruitAreaCodeMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/RecruitAreaCodeMapper.java @@ -6,6 +6,7 @@ import team.retum.jobis.domain.code.model.RecruitAreaCode; import team.retum.jobis.domain.code.persistence.entity.CodeEntity; import team.retum.jobis.domain.code.persistence.entity.RecruitAreaCodeEntity; +import team.retum.jobis.domain.code.persistence.entity.RecruitAreaCodeId; import team.retum.jobis.domain.code.persistence.repository.CodeJpaRepository; import team.retum.jobis.domain.recruitment.exception.RecruitAreaNotFoundException; import team.retum.jobis.domain.recruitment.persistence.entity.RecruitAreaEntity; @@ -22,16 +23,22 @@ public RecruitAreaCodeEntity toEntity(RecruitAreaCode domain) { RecruitAreaEntity recruitArea = recruitAreaJpaRepository.findById(domain.getRecruitAreaId()) .orElseThrow(() -> RecruitAreaNotFoundException.EXCEPTION); - CodeEntity code = codeJpaRepository.findById(domain.getCodeId()) + CodeEntity code = codeJpaRepository.findById(domain.getCode()) .orElseThrow(() -> CodeNotFoundException.EXCEPTION); - return new RecruitAreaCodeEntity(recruitArea, code); + return new RecruitAreaCodeEntity( + new RecruitAreaCodeId(domain.getRecruitAreaId(), domain.getCode()), + recruitArea, + code, + domain.getType() + ); } public RecruitAreaCode toDomain(RecruitAreaCodeEntity entity) { return RecruitAreaCode.builder() .recruitAreaId(entity.getRecruitArea().getId()) - .codeId(entity.getCode().getId()) + .code(entity.getCode().getCode()) + .type(entity.getType()) .build(); } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java index cbf87e334..10f365f0b 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java @@ -7,5 +7,5 @@ public interface CodeJpaRepository extends CrudRepository { - List findCodesByIdIn(List ids); + List findCodesByCodeIn(List ids); } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java index 0dea6c307..358940304 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java @@ -5,10 +5,8 @@ import lombok.Getter; import lombok.NoArgsConstructor; import team.retum.jobis.domain.code.persistence.entity.RecruitAreaCodeEntity; -import team.retum.jobis.global.converter.StringListConverter; import javax.persistence.Column; -import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; @@ -40,11 +38,6 @@ public class RecruitAreaEntity { @Column(columnDefinition = "VARCHAR(3500)") private String majorTask; - @NotNull - @Convert(converter = StringListConverter.class) - @Column(columnDefinition = "VARCHAR(40)") - private List jobCodes; - @Column(columnDefinition = "VARCHAR(500)") private String preferentialTreatment; @@ -57,11 +50,10 @@ public class RecruitAreaEntity { @Builder public RecruitAreaEntity(Long id, Integer hiredCount, String majorTask, String preferentialTreatment, - List jobCodes, RecruitmentEntity recruitmentEntity) { + RecruitmentEntity recruitmentEntity) { this.id = id; this.hiredCount = hiredCount; this.majorTask = majorTask; - this.jobCodes = jobCodes; this.preferentialTreatment = preferentialTreatment; this.recruitment = recruitmentEntity; } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitAreaMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitAreaMapper.java index d53d3454c..f165f63d9 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitAreaMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/mapper/RecruitAreaMapper.java @@ -22,7 +22,6 @@ public RecruitAreaEntity toEntity(RecruitArea domain) { .id(domain.getId()) .recruitmentEntity(recruitment) .hiredCount(domain.getHiredCount()) - .jobCodes(domain.getJobCodes()) .majorTask(domain.getMajorTask()) .preferentialTreatment(domain.getPreferentialTreatment()) .build(); @@ -33,8 +32,6 @@ public RecruitArea toDomain(RecruitAreaEntity entity) { .id(entity.getId()) .recruitmentId(entity.getRecruitment().getId()) .majorTask(entity.getMajorTask()) - .jobCodes(entity.getJobCodes()) - .majorTask(entity.getMajorTask()) .preferentialTreatment(entity.getPreferentialTreatment()) .build(); } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/converter/HiringProgressConverter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/converter/HiringProgressConverter.java index 485a1a785..68f621bf1 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/converter/HiringProgressConverter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/converter/HiringProgressConverter.java @@ -3,10 +3,12 @@ import team.retum.jobis.domain.recruitment.model.ProgressType; import javax.persistence.AttributeConverter; +import javax.persistence.Converter; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; +@Converter public class HiringProgressConverter implements AttributeConverter, String> { @Override diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/review/persistence/mapper/QnAMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/review/persistence/mapper/QnAMapper.java index 5cc347367..02c45c5a8 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/review/persistence/mapper/QnAMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/review/persistence/mapper/QnAMapper.java @@ -38,7 +38,7 @@ public QnA toDomain(QnAEntity entity) { .answer(entity.getAnswer()) .question(entity.getQuestion()) .reviewId(entity.getReview().getId()) - .codeId(entity.getCode().getId()) + .codeId(entity.getCode().getCode()) .build(); } } From 3b46be80f1edb5d7f9f4e76b4622891074a410a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Mon, 20 Nov 2023 22:12:55 +0900 Subject: [PATCH 32/45] =?UTF-8?q?=E2=9A=92=EF=B8=8F=20::=20(#448)=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=EB=B3=80=EA=B2=BD=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../code/service/GetKeywordsService.java | 7 +++ .../service/GetRecruitmentDetailService.java | 9 +-- .../service/SaveRecruitmentAreaService.java | 23 +++++-- .../recruitment/spi/vo/RecruitmentVO.java | 2 +- .../usecase/QueryMyRecruitmentUseCase.java | 8 ++- .../QueryRecruitmentDetailUseCase.java | 8 ++- .../StudentQueryRecruitmentsUseCase.java | 9 +-- .../TeacherQueryRecruitmentsUseCase.java | 4 +- .../persistence/CodePersistenceAdapter.java | 8 +-- .../RecruitmentPersistenceAdapter.java | 62 +++++++++++-------- .../repository/vo/QueryRecruitAreaVO.java | 11 +++- .../repository/vo/QueryRecruitmentsVO.java | 2 +- .../presentation/RecruitmentWebAdapter.java | 14 +++++ 13 files changed, 108 insertions(+), 59 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java index fdde6188e..6590431de 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/code/service/GetKeywordsService.java @@ -3,6 +3,7 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.Service; import team.retum.jobis.common.util.StringUtil; +import team.retum.jobis.domain.code.exception.CodeNotFoundException; import team.retum.jobis.domain.code.model.Code; import team.retum.jobis.domain.code.spi.QueryCodePort; @@ -28,4 +29,10 @@ public List getKeywordsAsList(List jobCodes) { jobCodes.stream().map(Long::parseLong).toList() ).stream().map(Code::getKeyword).toList(); } + + public String getCodeKeyword(Long code) { + return queryCodePort.queryCodeById(code) + .orElseThrow(() -> CodeNotFoundException.EXCEPTION) + .getKeyword(); + } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java index d6a4fb452..37f02a4b5 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/GetRecruitmentDetailService.java @@ -17,18 +17,13 @@ public class GetRecruitmentDetailService { private final QueryRecruitmentPort queryRecruitmentPort; - private final GetKeywordsService getKeywordsService; - - public QueryRecruitmentDetailResponse execute(Long recruitId) { - - Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(recruitId) - .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); + public QueryRecruitmentDetailResponse execute(Recruitment recruitment) { RecruitmentDetailVO recruitmentDetail = queryRecruitmentPort.queryRecruitmentDetailById(recruitment.getId()); List recruitAreaResponses = queryRecruitmentPort.queryRecruitAreasByRecruitmentId(recruitment.getId()) .stream().map(recruitAreaResponse -> RecruitAreaResponse.builder() .id(recruitAreaResponse.getId()) - .job(getKeywordsService.getKeywordsAsList(recruitAreaResponse.getJob())) + .job(recruitAreaResponse.getJob()) .tech(recruitAreaResponse.getTech()) .hiring(recruitAreaResponse.getHiring()) .majorTask(recruitAreaResponse.getMajorTask()) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java index 2985e91b7..5b8c10eba 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/service/SaveRecruitmentAreaService.java @@ -2,11 +2,13 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.Service; +import team.retum.jobis.domain.code.model.CodeType; import team.retum.jobis.domain.code.model.RecruitAreaCode; import team.retum.jobis.domain.recruitment.dto.request.CreateRecruitAreaRequest; import team.retum.jobis.domain.recruitment.model.RecruitArea; import team.retum.jobis.domain.recruitment.spi.CommandRecruitmentPort; +import java.util.ArrayList; import java.util.List; @RequiredArgsConstructor @@ -16,25 +18,34 @@ public class SaveRecruitmentAreaService { private final CommandRecruitmentPort commandRecruitmentPort; public void execute(CreateRecruitAreaRequest request, Long recruitmentId) { - List jobCodes = request.getJobCodes().stream().map(Object::toString).toList(); - RecruitArea savedRecruitArea = commandRecruitmentPort.saveRecruitmentArea( RecruitArea.builder() .recruitmentId(recruitmentId) .hiredCount(request.getHiring()) - .jobCodes(jobCodes) .majorTask(request.getMajorTask()) .preferentialTreatment(request.getPreferentialTreatment()) .build() ); - List recruitAreaCodes = request.getTechCodes().stream() + List recruitAreaCodes = new ArrayList<>(); + recruitAreaCodes.addAll(request.getTechCodes().stream() .map( code -> RecruitAreaCode.builder() .recruitAreaId(savedRecruitArea.getId()) - .codeId(code) + .code(code) + .type(CodeType.TECH) .build() - ).toList(); + ).toList() + ); + recruitAreaCodes.addAll(request.getJobCodes().stream() + .map( + code -> RecruitAreaCode.builder() + .recruitAreaId(savedRecruitArea.getId()) + .code(code) + .type(CodeType.JOB) + .build() + ).toList() + ); commandRecruitmentPort.saveAllRecruitmentAreaCodes(recruitAreaCodes); } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/vo/RecruitmentVO.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/vo/RecruitmentVO.java index 6bc894e0c..ddf87d92d 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/vo/RecruitmentVO.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/vo/RecruitmentVO.java @@ -24,7 +24,7 @@ public class RecruitmentVO { private final Integer totalHiring; private final Long requestedApplicationCount; private final Long approvedApplicationCount; - private final Long isBookmarked; + private final Boolean isBookmarked; private final Long companyId; } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java index 8fa4acc5a..b770811d2 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryMyRecruitmentUseCase.java @@ -4,7 +4,10 @@ import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.spi.SecurityPort; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; +import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; +import team.retum.jobis.domain.recruitment.model.Recruitment; import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; +import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; @RequiredArgsConstructor @ReadOnlyUseCase @@ -12,10 +15,13 @@ public class QueryMyRecruitmentUseCase { private final SecurityPort securityPort; private final GetRecruitmentDetailService getRecruitmentDetailService; + private final QueryRecruitmentPort queryRecruitmentPort; public QueryRecruitmentDetailResponse execute() { Long currentUserId = securityPort.getCurrentUserId(); + Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(currentUserId) + .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - return getRecruitmentDetailService.execute(currentUserId); + return getRecruitmentDetailService.execute(recruitment); } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java index 4d2fad287..43e3fa465 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/QueryRecruitmentDetailUseCase.java @@ -3,16 +3,22 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; +import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; +import team.retum.jobis.domain.recruitment.model.Recruitment; import team.retum.jobis.domain.recruitment.service.GetRecruitmentDetailService; +import team.retum.jobis.domain.recruitment.spi.QueryRecruitmentPort; @RequiredArgsConstructor @ReadOnlyUseCase public class QueryRecruitmentDetailUseCase { private final GetRecruitmentDetailService getRecruitmentDetailService; + private final QueryRecruitmentPort queryRecruitmentPort; public QueryRecruitmentDetailResponse execute(Long recruitId) { + Recruitment recruitment = queryRecruitmentPort.queryRecruitmentById(recruitId) + .orElseThrow(() -> RecruitmentNotFoundException.EXCEPTION); - return getRecruitmentDetailService.execute(recruitId); + return getRecruitmentDetailService.execute(recruitment); } } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java index 9818ed4d0..e8673b071 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java @@ -5,7 +5,6 @@ import team.retum.jobis.common.dto.response.TotalPageCountResponse; import team.retum.jobis.common.spi.SecurityPort; import team.retum.jobis.common.util.NumberUtil; -import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; import team.retum.jobis.domain.recruitment.dto.response.StudentQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.StudentQueryRecruitmentsResponse.StudentRecruitmentResponse; @@ -21,12 +20,10 @@ public class StudentQueryRecruitmentsUseCase { private final QueryRecruitmentPort queryRecruitmentPort; private final SecurityPort securityPort; - private final GetKeywordsService getKeywordsService; public StudentQueryRecruitmentsResponse execute( String name, Long page, - Long jobCode, List codeIds, Boolean winterIntern ) { @@ -39,7 +36,6 @@ public StudentQueryRecruitmentsResponse execute( .limit(12) .codes(codeIds) .studentId(currentStudentId) - .jobCode(jobCode) .winterIntern(winterIntern) .build(); @@ -50,11 +46,11 @@ public StudentQueryRecruitmentsResponse execute( .recruitId(recruitment.getRecruitmentId()) .companyName(recruitment.getCompanyName()) .trainPay(recruitment.getTrainPay()) - .jobCodeList(getKeywordsService.getKeywordsAsJoinedString(recruitment.getJobCodes())) + .jobCodeList(recruitment.getJobCodes()) .military(recruitment.isMilitarySupport()) .companyProfileUrl(recruitment.getCompanyLogoUrl()) .totalHiring(recruitment.getTotalHiring()) - .isBookmarked(recruitment.getIsBookmarked() != 0) + .isBookmarked(recruitment.getIsBookmarked()) .build() ).toList(); @@ -71,7 +67,6 @@ public TotalPageCountResponse getTotalPageCount(String name, Long jobCode, List< .limit(12) .codes(codeIds) .studentId(currentStudentId) - .jobCode(jobCode) .winterIntern(winterIntern) .build(); diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java index bd2a16e0e..0a4b1bd8a 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/TeacherQueryRecruitmentsUseCase.java @@ -4,7 +4,6 @@ import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.dto.response.TotalPageCountResponse; import team.retum.jobis.common.util.NumberUtil; -import team.retum.jobis.domain.code.service.GetKeywordsService; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; import team.retum.jobis.domain.recruitment.dto.response.TeacherQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.TeacherQueryRecruitmentsResponse.TeacherRecruitmentResponse; @@ -19,7 +18,6 @@ public class TeacherQueryRecruitmentsUseCase { private final QueryRecruitmentPort queryRecruitmentPort; - private final GetKeywordsService getKeywordsService; public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate start, LocalDate end, Integer year, RecruitStatus status, Long page, Boolean winterIntern) { @@ -48,7 +46,7 @@ public TeacherQueryRecruitmentsResponse execute(String companyName, LocalDate st .applicationRequestedCount(recruitment.getRequestedApplicationCount()) .applicationApprovedCount(recruitment.getApprovedApplicationCount()) .recruitmentCount(recruitment.getTotalHiring()) - .recruitmentJob(getKeywordsService.getKeywordsAsJoinedString(recruitment.getJobCodes())) + .recruitmentJob(recruitment.getJobCodes()) .companyId(recruitment.getCompanyId()) .build() ).toList(); diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java index da13ab748..b220fdee5 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/CodePersistenceAdapter.java @@ -28,7 +28,7 @@ public List queryCodesByKeywordAndType(String keyword, CodeType codeType, return jpaQueryFactory .selectFrom(codeEntity) .where( - codeEntity.codeType.eq(codeType), + codeEntity.type.eq(codeType), containsKeyword(keyword), eqParentCode(parentCode) ).fetch().stream() @@ -38,13 +38,13 @@ public List queryCodesByKeywordAndType(String keyword, CodeType codeType, @Override public Optional queryCodeById(Long codeId) { - return codeJpaRepository.findById(codeId) + return codeJpaRepository.findById(codeId) .map(codeMapper::toDomain); } @Override public List queryCodesByIdIn(List codes) { - return codeJpaRepository.findCodesByIdIn(codes).stream() + return codeJpaRepository.findCodesByCodeIn(codes).stream() .map(codeMapper::toDomain) .toList(); } @@ -56,6 +56,6 @@ private BooleanExpression containsKeyword(String keyword) { } private BooleanExpression eqParentCode(Long parentCode) { - return parentCode == null ? null : codeEntity.parentCode.id.eq(parentCode); + return parentCode == null ? null : codeEntity.parentCode.code.eq(parentCode); } } \ No newline at end of file diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java index 177e746d9..4a6d98aad 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java @@ -1,7 +1,9 @@ package team.retum.jobis.domain.recruitment.persistence; +import com.querydsl.core.types.ExpressionUtils; import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.Expressions; +import com.querydsl.core.types.dsl.StringExpression; import com.querydsl.jpa.impl.JPAQueryFactory; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; @@ -32,7 +34,9 @@ import static com.querydsl.core.group.GroupBy.groupBy; import static com.querydsl.core.group.GroupBy.list; +import static com.querydsl.jpa.JPAExpressions.select; import static team.retum.jobis.domain.bookmark.persistence.entity.QBookmarkEntity.bookmarkEntity; +import static team.retum.jobis.domain.code.model.CodeType.JOB; import static team.retum.jobis.domain.code.persistence.entity.QCodeEntity.codeEntity; import static team.retum.jobis.domain.code.persistence.entity.QRecruitAreaCodeEntity.recruitAreaCodeEntity; import static team.retum.jobis.domain.company.persistence.entity.QCompanyEntity.companyEntity; @@ -56,6 +60,7 @@ public List queryRecruitmentsByFilter(RecruitmentFilter filter) { QApplicationEntity requestedApplication = new QApplicationEntity("requestedApplication"); QApplicationEntity approvedApplication = new QApplicationEntity("approvedApplication"); + StringExpression recruitJobsPath = Expressions.stringTemplate("group_concat({0})", codeEntity.keyword); return queryFactory .select( new QQueryRecruitmentsVO( @@ -68,30 +73,44 @@ public List queryRecruitmentsByFilter(RecruitmentFilter filter) { recruitmentEntity.payInfo.trainPay, recruitmentEntity.militarySupport, companyEntity.companyLogoUrl, - Expressions.stringTemplate("group_concat({0})", recruitAreaEntity.jobCodes), + recruitJobsPath, recruitAreaEntity.hiredCount.sum(), requestedApplication.countDistinct(), approvedApplication.countDistinct(), - bookmarkEntity.count(), + filter.getStudentId() != null ? + ExpressionUtils.as( + select(bookmarkEntity.count().gt(0)) + .from(bookmarkEntity) + .where( + bookmarkEntity.student.id.eq(filter.getStudentId()), + bookmarkEntity.recruitment.id.eq(recruitmentEntity.id) + ), "isBookmarked") + : Expressions.asBoolean(false), companyEntity.id ) ) .from(recruitmentEntity) - .join(recruitmentEntity.recruitAreas, recruitAreaEntity) .join(recruitmentEntity.company, companyEntity) - .leftJoin(recruitmentEntity.applications, requestedApplication) - .on(requestedApplication.applicationStatus.eq(ApplicationStatus.REQUESTED)) - .leftJoin(recruitmentEntity.applications, approvedApplication) - .on(approvedApplication.applicationStatus.eq(ApplicationStatus.APPROVED)) - .leftJoin(bookmarkEntity) - .on(eqStudentId(filter.getStudentId())) + .join(recruitmentEntity.recruitAreas, recruitAreaEntity) + .join(recruitAreaEntity.recruitAreaCodes, recruitAreaCodeEntity) + .on(recruitAreaCodeEntity.type.eq(JOB)) + .join(recruitAreaCodeEntity.code, codeEntity) + .leftJoin(requestedApplication) + .on( + requestedApplication.recruitment.id.eq(recruitmentEntity.id), + requestedApplication.applicationStatus.eq(ApplicationStatus.REQUESTED) + ) + .leftJoin(approvedApplication) + .on( + approvedApplication.recruitment.id.eq(recruitmentEntity.id), + approvedApplication.applicationStatus.eq(ApplicationStatus.APPROVED) + ) .where( eqYear(filter.getYear()), betweenRecruitDate(filter.getStartDate(), filter.getEndDate()), eqRecruitStatus(filter.getStatus()), containsName(filter.getCompanyName()), containsCodes(filter.getCodes()), - containsJobCode(filter.getJobCode()), eqWinterIntern(filter.getWinterIntern()) ) .offset(filter.getOffset()) @@ -138,17 +157,21 @@ public Long getRecruitmentCountByFilter(RecruitmentFilter filter) { return queryFactory .select(recruitmentEntity.count()) .from(recruitmentEntity) - .join(recruitmentEntity.company, companyEntity) .join(recruitmentEntity.recruitAreas, recruitAreaEntity) + .join(recruitAreaEntity.recruitAreaCodes, recruitAreaCodeEntity) + .on(recruitAreaCodeEntity.type.eq(JOB)) + .join(recruitAreaCodeEntity.code, codeEntity) + .on(codeEntity.type.eq(JOB)) .where( eqYear(filter.getYear()), betweenRecruitDate(filter.getStartDate(), filter.getEndDate()), eqRecruitStatus(filter.getStatus()), containsName(filter.getCompanyName()), containsCodes(filter.getCodes()), - containsJobCode(filter.getJobCode()), eqWinterIntern(filter.getWinterIntern()) - ).fetchOne(); + ) + .groupBy(recruitmentEntity.id) + .fetchOne(); } @Override @@ -165,7 +188,6 @@ public List queryRecruitAreasByRecruitmentId(Long recruitme recruitAreaEntity.id, recruitAreaEntity.hiredCount, recruitAreaEntity.majorTask, - recruitAreaEntity.jobCodes, recruitAreaEntity.preferentialTreatment, list(codeEntity) ) @@ -300,19 +322,9 @@ private BooleanExpression containsName(String name) { } private BooleanExpression containsCodes(List codes) { - return codes.isEmpty() ? null : recruitAreaEntity.recruitAreaCodes.any().code.id.in(codes); - } - - private BooleanExpression eqStudentId(Long studentId) { - return studentId == null ? bookmarkEntity.recruitment.eq(recruitmentEntity) : bookmarkEntity.student.id.eq(studentId).and(bookmarkEntity.recruitment.eq(recruitmentEntity)); + return codes.isEmpty() ? null : recruitAreaEntity.recruitAreaCodes.any().code.code.in(codes); } - - private BooleanExpression containsJobCode(Long jobCode) { - return jobCode == null ? null : Expressions.stringTemplate("cast({0} as string)", recruitAreaEntity.jobCodes).contains(jobCode.toString()); - } - private BooleanExpression eqWinterIntern(Boolean winterIntern) { return winterIntern == null ? null : recruitmentEntity.winterIntern.eq(winterIntern); } - } \ No newline at end of file diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitAreaVO.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitAreaVO.java index b82f8bf59..4862218b1 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitAreaVO.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitAreaVO.java @@ -2,6 +2,7 @@ import com.querydsl.core.annotations.QueryProjection; import lombok.Getter; +import team.retum.jobis.domain.code.model.CodeType; import team.retum.jobis.domain.code.persistence.entity.CodeEntity; import team.retum.jobis.domain.recruitment.dto.response.RecruitAreaResponse; @@ -12,11 +13,15 @@ public class QueryRecruitAreaVO extends RecruitAreaResponse { @QueryProjection public QueryRecruitAreaVO(Long id, Integer hiredCount, String majorTask, - List jobCodes, String preferentialTreatment, List techCode) { + String preferentialTreatment, List codes) { super( id, - jobCodes, - techCode.stream() + codes.stream() + .filter(code -> code.getType().equals(CodeType.JOB)) + .map(CodeEntity::getKeyword) + .toList(), + codes.stream() + .filter(code -> code.getType().equals(CodeType.TECH)) .map(CodeEntity::getKeyword) .toList(), hiredCount, diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitmentsVO.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitmentsVO.java index acf2237f9..c36a6da71 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitmentsVO.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/vo/QueryRecruitmentsVO.java @@ -16,7 +16,7 @@ public QueryRecruitmentsVO(Long recruitmentId, RecruitStatus recruitStatus, Loca LocalDate endDate, String companyName, CompanyType companyType, Integer trainPay, boolean militarySupport, String companyLogoUrl, String jobCodes, Integer totalHiring, Long requestedApplicationCount, - Long approvedApplicationCount, Long isBookmarked, Long companyId) { + Long approvedApplicationCount, Boolean isBookmarked, Long companyId) { super(recruitmentId, recruitStatus, startDate, endDate, companyName, companyType, trainPay, militarySupport, companyLogoUrl, jobCodes, totalHiring, requestedApplicationCount, approvedApplicationCount, isBookmarked, companyId); diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java index 7bb39373c..9bbcc1348 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java @@ -96,23 +96,37 @@ public void createRecruitArea( public StudentQueryRecruitmentsResponse studentQueryRecruitments( @RequestParam(value = "name", required = false) String companyName, @RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page, +<<<<<<< develop @RequestParam(value = "job_code", required = false) Long jobCode, @RequestParam(value = "tech_code", required = false) String techCode, @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { List techCodes = StringUtil.divideString(techCode, ",").stream().map(Long::parseLong).toList(); return studentQueryRecruitmentsUseCase.execute(companyName, page - 1, jobCode, techCodes, winterIntern); +======= + @RequestParam(value = "codes", required = false) String codes + ) { + List parsed = StringUtil.divideString(codes, ",").stream().map(Long::parseLong).toList(); + return studentQueryRecruitmentsUseCase.execute(companyName, page - 1, parsed); +>>>>>>> ⚒️ :: (#448) 구조변경에 따른 코드 변경 } @GetMapping("/student/count") public TotalPageCountResponse studentQueryRecruitmentCount( @RequestParam(value = "name", required = false) String companyName, +<<<<<<< develop @RequestParam(value = "job_code", required = false) Long jobCode, @RequestParam(value = "tech_code", required = false) String techCode, @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { List techCodes = StringUtil.divideString(techCode, ",").stream().map(Long::parseLong).toList(); return studentQueryRecruitmentsUseCase.getTotalPageCount(companyName, jobCode, techCodes, winterIntern); +======= + @RequestParam(value = "codes", required = false) String codes + ) { + List parsed = StringUtil.divideString(codes, ",").stream().map(Long::parseLong).toList(); + return studentQueryRecruitmentsUseCase.getTotalPageCount(companyName, parsed); +>>>>>>> ⚒️ :: (#448) 구조변경에 따른 코드 변경 } @GetMapping("/teacher") From 152e5c34ab21ea84e5388268edb475fb151fd944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Mon, 20 Nov 2023 22:59:13 +0900 Subject: [PATCH 33/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#448)=20list?= =?UTF-8?q?=20add=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../retum/jobis/common/util/StringUtil.java | 11 +++-- .../presentation/RecruitmentWebAdapter.java | 48 ++++++++++--------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java b/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java index 57035ddb8..f9a679be2 100644 --- a/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java +++ b/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java @@ -4,6 +4,8 @@ import lombok.NoArgsConstructor; import net.bytebuddy.utility.RandomString; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; @NoArgsConstructor(access = AccessLevel.PRIVATE) @@ -13,15 +15,14 @@ public static String joinStringList(List request, String key) { return request == null ? null : String.join(key, request.stream().map(Object::toString).toList()); } - public static String mergeString(String str1, String str2) { - return str1 + " " + str2; - } - public static List divideString(String content, String key) { if (content == null || content.isEmpty()) { return List.of(); } - return List.of(content.split(key)); + + List dividedList = Arrays.asList(content.split(key)); + + return new ArrayList<>(dividedList); } public static String generateRandomCode(int size) { diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java index 9bbcc1348..7424006e4 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java @@ -39,6 +39,7 @@ import javax.validation.Valid; import javax.validation.constraints.Positive; import java.time.LocalDate; +import java.util.ArrayList; import java.util.List; @RestController @@ -96,37 +97,40 @@ public void createRecruitArea( public StudentQueryRecruitmentsResponse studentQueryRecruitments( @RequestParam(value = "name", required = false) String companyName, @RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page, -<<<<<<< develop - @RequestParam(value = "job_code", required = false) Long jobCode, - @RequestParam(value = "tech_code", required = false) String techCode, + @RequestParam(value = "tech_code", required = false) String techCodes, + @RequestParam(value = "job_code", required = false) String jobCode @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { - List techCodes = StringUtil.divideString(techCode, ",").stream().map(Long::parseLong).toList(); - return studentQueryRecruitmentsUseCase.execute(companyName, page - 1, jobCode, techCodes, winterIntern); -======= - @RequestParam(value = "codes", required = false) String codes - ) { - List parsed = StringUtil.divideString(codes, ",").stream().map(Long::parseLong).toList(); - return studentQueryRecruitmentsUseCase.execute(companyName, page - 1, parsed); ->>>>>>> ⚒️ :: (#448) 구조변경에 따른 코드 변경 + List parsed = new ArrayList<>(StringUtil.divideString(techCodes, ",")); + if (jobCode != null) + parsed.add(jobCode); + + return studentQueryRecruitmentsUseCase.execute( + companyName, + page - 1, + parsed.stream() + .map(Long::parseLong) + .toList() + ); } @GetMapping("/student/count") public TotalPageCountResponse studentQueryRecruitmentCount( @RequestParam(value = "name", required = false) String companyName, -<<<<<<< develop - @RequestParam(value = "job_code", required = false) Long jobCode, - @RequestParam(value = "tech_code", required = false) String techCode, + @RequestParam(value = "tech_code", required = false) String techCodes, + @RequestParam(value = "job_code", required = false) String jobCode @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { - List techCodes = StringUtil.divideString(techCode, ",").stream().map(Long::parseLong).toList(); - return studentQueryRecruitmentsUseCase.getTotalPageCount(companyName, jobCode, techCodes, winterIntern); -======= - @RequestParam(value = "codes", required = false) String codes - ) { - List parsed = StringUtil.divideString(codes, ",").stream().map(Long::parseLong).toList(); - return studentQueryRecruitmentsUseCase.getTotalPageCount(companyName, parsed); ->>>>>>> ⚒️ :: (#448) 구조변경에 따른 코드 변경 + List parsed = new ArrayList<>(StringUtil.divideString(techCodes, ",")); + if (jobCode != null) + parsed.add(jobCode); + + return studentQueryRecruitmentsUseCase.getTotalPageCount( + companyName, + parsed.stream() + .map(Long::parseLong) + .toList() + ); } @GetMapping("/teacher") From d91067b609b135c54998946b19ae1bd9aeb6158c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Mon, 20 Nov 2023 23:08:38 +0900 Subject: [PATCH 34/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#448)=20remove=20unu?= =?UTF-8?q?sed=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/retum/jobis/domain/recruitment/model/RecruitArea.java | 2 -- .../jobis/domain/student/persistence/entity/StudentEntity.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java index d93986609..7d29a3f54 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/model/RecruitArea.java @@ -4,8 +4,6 @@ import lombok.Getter; import team.retum.jobis.common.annotation.Aggregate; -import java.util.List; - @Getter @Builder @Aggregate diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java index 4cf7144de..c62aa4873 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java @@ -26,9 +26,7 @@ import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.UniqueConstraint; -import javax.persistence.criteria.CriteriaBuilder; import javax.validation.constraints.NotNull; -import java.time.Year; import java.util.ArrayList; import java.util.List; From dbf687f62c962ae29cdc35a303f6ec3057b1eb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 08:31:00 +0900 Subject: [PATCH 35/45] =?UTF-8?q?=E2=9A=92=EF=B8=8F=20::=20(#448)=20one=20?= =?UTF-8?q?to=20many=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationPersistenceAdapter.java | 9 ++++--- .../CompanyPersistenceAdapter.java | 13 +++++++--- .../persistence/entity/CompanyEntity.java | 6 ----- .../RecruitmentPersistenceAdapter.java | 26 ++++++++++++------- .../persistence/entity/RecruitAreaEntity.java | 3 --- .../persistence/entity/RecruitmentEntity.java | 6 ----- .../presentation/RecruitmentWebAdapter.java | 14 +++++----- .../persistence/entity/StudentEntity.java | 6 ----- 8 files changed, 38 insertions(+), 45 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java index fdf265494..67393984a 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java @@ -175,11 +175,14 @@ public QueryTotalApplicationCountVO queryTotalApplicationCount() { ) .from(applicationEntity) .leftJoin(applicationEntity.student, approvedStudent) - .on(approvedStudent.applications.any().applicationStatus.eq(APPROVED)) + .on( + applicationEntity.applicationStatus.eq(APPROVED), + applicationEntity.student.id.eq(approvedStudent.id) + ) .leftJoin(applicationEntity.student, passedStudent) .on( - passedStudent.applications.any().applicationStatus.eq(PASS) - .or(passedStudent.applications.any().applicationStatus.eq(FIELD_TRAIN)) + applicationEntity.applicationStatus.in(PASS, FIELD_TRAIN), + applicationEntity.student.id.eq(passedStudent.id) ) .rightJoin(applicationEntity.student, studentEntity) .on(studentEntity.grade.eq(3)) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/CompanyPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/CompanyPersistenceAdapter.java index 907d29cd9..bf44fc4c6 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/CompanyPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/CompanyPersistenceAdapter.java @@ -200,14 +200,19 @@ public List queryEmployCompanies(CompanyFilter filter) ) ) .from(companyEntity) - .leftJoin(companyEntity.acceptances, acceptanceEntity) - .leftJoin(companyEntity.recruitments, recruitmentEntity) + .leftJoin(acceptanceEntity) + .on(acceptanceEntity.company.id.eq(companyEntity.id)) + .leftJoin(recruitmentEntity) + .on(recruitmentEntity.company.id.eq(companyEntity.id)) .on( recruitmentEntity.company.id.eq(companyEntity.id), recentRecruitment(null) ) - .leftJoin(recruitmentEntity.applications, applicationEntity) - .on(applicationEntity.applicationStatus.eq(FIELD_TRAIN)) + .leftJoin(applicationEntity) + .on( + applicationEntity.applicationStatus.eq(FIELD_TRAIN), + applicationEntity.recruitment.id.eq(recruitmentEntity.id) + ) .where( containsName(filter.getName()), eqCompanyType(filter.getType()), diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java index e73fa204f..8e76f91b0 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java @@ -122,12 +122,6 @@ public class CompanyEntity { @Column(columnDefinition = "VARCHAR(1000)") private List attachmentUrls; - @OneToMany(mappedBy = "company") - private final List recruitments = new ArrayList<>(); - - @OneToMany(mappedBy = "company") - private final List acceptances = new ArrayList<>(); - @Builder public CompanyEntity(Long id, UserEntity userEntity, String name, String mainAddress, String mainAddressDetail, String mainZipCode, String subAddress, String subAddressDetail, String subZipCode, List attachmentUrls, diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java index 4a6d98aad..5b1d5c786 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java @@ -91,9 +91,13 @@ public List queryRecruitmentsByFilter(RecruitmentFilter filter) { ) .from(recruitmentEntity) .join(recruitmentEntity.company, companyEntity) - .join(recruitmentEntity.recruitAreas, recruitAreaEntity) - .join(recruitAreaEntity.recruitAreaCodes, recruitAreaCodeEntity) - .on(recruitAreaCodeEntity.type.eq(JOB)) + .join(recruitAreaEntity) + .on(recruitAreaEntity.recruitment.id.eq(recruitmentEntity.id)) + .join(recruitAreaCodeEntity) + .on( + recruitAreaCodeEntity.recruitArea.id.eq(recruitAreaEntity.id), + recruitAreaCodeEntity.type.eq(JOB) + ) .join(recruitAreaCodeEntity.code, codeEntity) .leftJoin(requestedApplication) .on( @@ -157,11 +161,14 @@ public Long getRecruitmentCountByFilter(RecruitmentFilter filter) { return queryFactory .select(recruitmentEntity.count()) .from(recruitmentEntity) - .join(recruitmentEntity.recruitAreas, recruitAreaEntity) - .join(recruitAreaEntity.recruitAreaCodes, recruitAreaCodeEntity) - .on(recruitAreaCodeEntity.type.eq(JOB)) + .join(recruitAreaEntity) + .on(recruitAreaEntity.recruitment.id.eq(recruitmentEntity.id)) + .join(recruitAreaCodeEntity) + .on( + recruitAreaCodeEntity.recruitArea.id.eq(recruitAreaEntity.id), + recruitAreaCodeEntity.type.eq(JOB) + ) .join(recruitAreaCodeEntity.code, codeEntity) - .on(codeEntity.type.eq(JOB)) .where( eqYear(filter.getYear()), betweenRecruitDate(filter.getStartDate(), filter.getEndDate()), @@ -178,7 +185,8 @@ public Long getRecruitmentCountByFilter(RecruitmentFilter filter) { public List queryRecruitAreasByRecruitmentId(Long recruitmentId) { return queryFactory .selectFrom(recruitAreaEntity) - .join(recruitAreaEntity.recruitAreaCodes, recruitAreaCodeEntity) + .join(recruitAreaCodeEntity) + .on(recruitAreaCodeEntity.recruitArea.id.eq(recruitAreaEntity.id)) .join(recruitAreaCodeEntity.code, codeEntity) .where(recruitAreaEntity.recruitment.id.eq(recruitmentId)) .transform( @@ -322,7 +330,7 @@ private BooleanExpression containsName(String name) { } private BooleanExpression containsCodes(List codes) { - return codes.isEmpty() ? null : recruitAreaEntity.recruitAreaCodes.any().code.code.in(codes); + return codes.isEmpty() ? null : recruitAreaCodeEntity.code.code.in(codes); } private BooleanExpression eqWinterIntern(Boolean winterIntern) { return winterIntern == null ? null : recruitmentEntity.winterIntern.eq(winterIntern); diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java index 358940304..387219f1c 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java @@ -45,9 +45,6 @@ public class RecruitAreaEntity { @JoinColumn(name = "recruitment_id", nullable = false) private RecruitmentEntity recruitment; - @OneToMany(mappedBy = "recruitArea", orphanRemoval = true) - private List recruitAreaCodes = new ArrayList<>(); - @Builder public RecruitAreaEntity(Long id, Integer hiredCount, String majorTask, String preferentialTreatment, RecruitmentEntity recruitmentEntity) { diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java index 6ccc685fb..5d84f47d7 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitmentEntity.java @@ -106,12 +106,6 @@ public class RecruitmentEntity extends BaseTimeEntity { @JoinColumn(name = "company_id", nullable = false) private CompanyEntity company; - @OneToMany(mappedBy = "recruitment", orphanRemoval = true) - private final List recruitAreas = new ArrayList<>(); - - @OneToMany(mappedBy = "recruitment") - private final List applications = new ArrayList<>(); - @Builder public RecruitmentEntity(Long id, int recruitYear, RecruitStatus status, Integer trainPay, String pay, LocalTime startTime, LocalTime endTime, String submitDocument, LocalDate startDate, diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java index 7424006e4..a60e31cb2 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java @@ -101,14 +101,13 @@ public StudentQueryRecruitmentsResponse studentQueryRecruitments( @RequestParam(value = "job_code", required = false) String jobCode @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { - List parsed = new ArrayList<>(StringUtil.divideString(techCodes, ",")); - if (jobCode != null) - parsed.add(jobCode); + List codes = new ArrayList<>(StringUtil.divideString(techCodes, ",")); + if (jobCode != null) codes.add(jobCode); return studentQueryRecruitmentsUseCase.execute( companyName, page - 1, - parsed.stream() + codes.stream() .map(Long::parseLong) .toList() ); @@ -121,13 +120,12 @@ public TotalPageCountResponse studentQueryRecruitmentCount( @RequestParam(value = "job_code", required = false) String jobCode @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { - List parsed = new ArrayList<>(StringUtil.divideString(techCodes, ",")); - if (jobCode != null) - parsed.add(jobCode); + List codes = new ArrayList<>(StringUtil.divideString(techCodes, ",")); + if (jobCode != null) codes.add(jobCode); return studentQueryRecruitmentsUseCase.getTotalPageCount( companyName, - parsed.stream() + codes.stream() .map(Long::parseLong) .toList() ); diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java index c62aa4873..c7ca8cdcf 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java @@ -87,12 +87,6 @@ public class StudentEntity { @Column(columnDefinition = "YEAR") private Integer entranceYear; - @OneToMany(mappedBy = "student", orphanRemoval = true) - private final List applications = new ArrayList<>(); - - @OneToMany(mappedBy = "student", orphanRemoval = true) - private List bookmarks = new ArrayList<>(); - @Builder public StudentEntity(Long id, UserEntity userEntity, String name, Integer grade, Integer classRoom, Integer number, Gender gender, From e355fcde3b9ee604277cf5c6b1b8823a862545f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 16:36:30 +0900 Subject: [PATCH 36/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#448)=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 강민 --- .../domain/code/persistence/repository/CodeJpaRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java index 10f365f0b..34a4f7a03 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/repository/CodeJpaRepository.java @@ -7,5 +7,5 @@ public interface CodeJpaRepository extends CrudRepository { - List findCodesByCodeIn(List ids); + List findCodesByCodeIn(List codes); } From 282e4b573e680d9195521bf37e03d3c92fd5f0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 16:37:06 +0900 Subject: [PATCH 37/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#448)=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 강민 --- .../retum/jobis/domain/code/persistence/entity/CodeEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java index c2b4a6a85..757eaaf88 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java @@ -48,7 +48,7 @@ public class CodeEntity { private CodeEntity parentCode; @Builder - public CodeEntity(Long id, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity) { + public CodeEntity(Long code, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity) { this.code = id; this.type = codeType; this.jobType = jobType; From 96d54750ee30be2f6c52bf8e19f074916e3b4ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 16:40:07 +0900 Subject: [PATCH 38/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#448)=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../retum/jobis/domain/code/persistence/entity/CodeEntity.java | 2 +- .../retum/jobis/domain/code/persistence/mapper/CodeMapper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java index 757eaaf88..f7f248812 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/entity/CodeEntity.java @@ -49,7 +49,7 @@ public class CodeEntity { @Builder public CodeEntity(Long code, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity) { - this.code = id; + this.code = code; this.type = codeType; this.jobType = jobType; this.keyword = keyword; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java index ef042384e..9c86944ca 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/code/persistence/mapper/CodeMapper.java @@ -19,7 +19,7 @@ public CodeEntity toEntity(Code domain) { .orElseThrow(() -> CodeNotFoundException.EXCEPTION); return CodeEntity.builder() - .id(domain.getId()) + .code(domain.getId()) .codeType(domain.getCodeType()) .keyword(domain.getKeyword()) .jobType(domain.getJobType()) From bca2782f19623c1747097bcb89cc1647448d8476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 16:49:43 +0900 Subject: [PATCH 39/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#448)=20confli?= =?UTF-8?q?ct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usecase/StudentQueryRecruitmentsUseCase.java | 2 +- .../presentation/RecruitmentWebAdapter.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java index e8673b071..9b56ebac8 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/StudentQueryRecruitmentsUseCase.java @@ -57,7 +57,7 @@ public StudentQueryRecruitmentsResponse execute( return new StudentQueryRecruitmentsResponse(recruitments); } - public TotalPageCountResponse getTotalPageCount(String name, Long jobCode, List codeIds, Boolean winterIntern) { + public TotalPageCountResponse getTotalPageCount(String name, List codeIds, Boolean winterIntern) { Long currentStudentId = securityPort.getCurrentUserId(); RecruitmentFilter filter = RecruitmentFilter.builder() diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java index a60e31cb2..014ebb076 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/presentation/RecruitmentWebAdapter.java @@ -98,7 +98,7 @@ public StudentQueryRecruitmentsResponse studentQueryRecruitments( @RequestParam(value = "name", required = false) String companyName, @RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page, @RequestParam(value = "tech_code", required = false) String techCodes, - @RequestParam(value = "job_code", required = false) String jobCode + @RequestParam(value = "job_code", required = false) String jobCode, @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { List codes = new ArrayList<>(StringUtil.divideString(techCodes, ",")); @@ -109,7 +109,8 @@ public StudentQueryRecruitmentsResponse studentQueryRecruitments( page - 1, codes.stream() .map(Long::parseLong) - .toList() + .toList(), + winterIntern ); } @@ -117,7 +118,7 @@ public StudentQueryRecruitmentsResponse studentQueryRecruitments( public TotalPageCountResponse studentQueryRecruitmentCount( @RequestParam(value = "name", required = false) String companyName, @RequestParam(value = "tech_code", required = false) String techCodes, - @RequestParam(value = "job_code", required = false) String jobCode + @RequestParam(value = "job_code", required = false) String jobCode, @RequestParam(value = "winter_intern", required = false) Boolean winterIntern ) { List codes = new ArrayList<>(StringUtil.divideString(techCodes, ",")); @@ -127,7 +128,8 @@ public TotalPageCountResponse studentQueryRecruitmentCount( companyName, codes.stream() .map(Long::parseLong) - .toList() + .toList(), + winterIntern ); } From 05247c9bdd059642dbf5ed83f9a5800fa1fe9fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 16:52:43 +0900 Subject: [PATCH 40/45] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#448)=20remove=20unu?= =?UTF-8?q?sed=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/company/persistence/entity/CompanyEntity.java | 4 ---- .../recruitment/persistence/entity/RecruitAreaEntity.java | 4 ---- .../domain/student/persistence/entity/StudentEntity.java | 5 ----- 3 files changed, 13 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java index 8e76f91b0..4a99a80b6 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/entity/CompanyEntity.java @@ -7,11 +7,9 @@ import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; -import team.retum.jobis.domain.acceptance.persistence.entity.AcceptanceEntity; import team.retum.jobis.domain.company.model.CompanyType; import team.retum.jobis.domain.company.persistence.entity.type.Address; import team.retum.jobis.domain.company.persistence.entity.type.Manager; -import team.retum.jobis.domain.recruitment.persistence.entity.RecruitmentEntity; import team.retum.jobis.domain.user.persistence.entity.UserEntity; import team.retum.jobis.global.converter.StringListConverter; import team.retum.jobis.global.util.ImageProperty; @@ -27,12 +25,10 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.MapsId; -import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; import javax.validation.constraints.NotNull; import java.time.LocalDate; -import java.util.ArrayList; import java.util.List; @Getter diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java index 387219f1c..70347bc04 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/entity/RecruitAreaEntity.java @@ -4,7 +4,6 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import team.retum.jobis.domain.code.persistence.entity.RecruitAreaCodeEntity; import javax.persistence.Column; import javax.persistence.Entity; @@ -14,11 +13,8 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; import javax.persistence.Table; import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.List; @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java index c7ca8cdcf..d7d87c106 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/student/persistence/entity/StudentEntity.java @@ -6,8 +6,6 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.DynamicInsert; -import team.retum.jobis.domain.application.persistence.entity.ApplicationEntity; -import team.retum.jobis.domain.bookmark.persistence.entity.BookmarkEntity; import team.retum.jobis.domain.student.model.Department; import team.retum.jobis.domain.student.model.Gender; import team.retum.jobis.domain.user.persistence.entity.UserEntity; @@ -22,13 +20,10 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.MapsId; -import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.List; @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) From 754bd30770d7cc4c6c457711da416ed807dfccab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 18:16:14 +0900 Subject: [PATCH 41/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20?= =?UTF-8?q?=EC=9E=84=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/persistence/RecruitmentPersistenceAdapter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java index 5b1d5c786..3b5d0caaa 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java @@ -177,7 +177,6 @@ public Long getRecruitmentCountByFilter(RecruitmentFilter filter) { containsCodes(filter.getCodes()), eqWinterIntern(filter.getWinterIntern()) ) - .groupBy(recruitmentEntity.id) .fetchOne(); } From 052442a6fff7badad2aa7ec5cd136625be7d02d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 19:41:30 +0900 Subject: [PATCH 42/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20co?= =?UTF-8?q?mpany=20join?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/persistence/RecruitmentPersistenceAdapter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java index 3b5d0caaa..b58ea52b2 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java @@ -169,6 +169,7 @@ public Long getRecruitmentCountByFilter(RecruitmentFilter filter) { recruitAreaCodeEntity.type.eq(JOB) ) .join(recruitAreaCodeEntity.code, codeEntity) + .join(recruitmentEntity.company, companyEntity) .where( eqYear(filter.getYear()), betweenRecruitDate(filter.getStartDate(), filter.getEndDate()), From 073af24b85ca36e2f458cca2a593f12919e6b217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 19:44:31 +0900 Subject: [PATCH 43/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20bl?= =?UTF-8?q?ank=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/team/retum/jobis/common/util/StringUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java b/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java index f9a679be2..f64732406 100644 --- a/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java +++ b/jobis-application/src/main/java/team/retum/jobis/common/util/StringUtil.java @@ -16,7 +16,7 @@ public static String joinStringList(List request, String key) { } public static List divideString(String content, String key) { - if (content == null || content.isEmpty()) { + if (content == null || content.isEmpty() || content.isBlank()) { return List.of(); } From b63242549f72b340580af24fe74a59f725c273b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 20:00:57 +0900 Subject: [PATCH 44/45] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20co?= =?UTF-8?q?rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team/retum/jobis/global/web/WebSecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/global/web/WebSecurityConfig.java b/jobis-infrastructure/src/main/java/team/retum/jobis/global/web/WebSecurityConfig.java index e7a2bdae5..5fe30f2dc 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/global/web/WebSecurityConfig.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/global/web/WebSecurityConfig.java @@ -19,7 +19,7 @@ public void addCorsMappings(CorsRegistry registry) { "http://lcoalhost:3001", "http://localhost:4000" ) - .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE") + .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "HEAD") .allowedHeaders("*"); } } From e5f96013846194c3488260699dfa0f2e0b9ffd50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Tue, 21 Nov 2023 20:13:21 +0900 Subject: [PATCH 45/45] =?UTF-8?q?=E2=9A=92=EF=B8=8F=20::=20(#develop)=20do?= =?UTF-8?q?main=20logic=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../retum/jobis/domain/application/model/Application.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/model/Application.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/model/Application.java index 6b162bd63..2e7f49292 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/model/Application.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/model/Application.java @@ -44,10 +44,6 @@ public Application toFieldTrain(LocalDate startDate, LocalDate endDate) { } public Application rejectApplication(String reason) { - if (applicationStatus != ApplicationStatus.REQUESTED) { - throw ApplicationStatusCannotChangeException.EXCEPTION; - } - return this.toBuilder() .applicationStatus(ApplicationStatus.REJECTED) .rejectionReason(reason)