From ba4ba86ce6786c6b17e1acaecbc9517bfc2bc154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AA=85=EC=A7=84?= <4mj.eo@dsm.hs.kr> Date: Wed, 6 Nov 2024 22:27:54 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#832)=20response=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/RecruitmentExistsResponse.java | 13 +++++++++++++ .../presentation/RecruitmentWebAdapter.java | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java new file mode 100644 index 000000000..50b8430a5 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java @@ -0,0 +1,13 @@ +package team.retum.jobis.domain.recruitment.dto.response; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@AllArgsConstructor +@NoArgsConstructor(force = true) +public class RecruitmentExistsResponse { + + private boolean exists; +} 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 fb22b34eb..509fb58cd 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 @@ -27,6 +27,7 @@ import team.retum.jobis.domain.recruitment.dto.response.QueryMyRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.QueryRecruitmentDetailResponse; import team.retum.jobis.domain.recruitment.dto.response.RecruitmentCountResponse; +import team.retum.jobis.domain.recruitment.dto.response.RecruitmentExistsResponse; import team.retum.jobis.domain.recruitment.dto.response.StudentQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.dto.response.TeacherQueryRecruitmentsResponse; import team.retum.jobis.domain.recruitment.model.RecruitStatus; @@ -253,8 +254,9 @@ public byte[] exportRecruitmentHistory(HttpServletResponse httpResponse) { } @GetMapping("/exists") - public boolean checkRecruitmentExists(@RequestParam(value = "winter_intern") Boolean winterIntern) { - return checkRecruitmentExistsUseCase.execute(winterIntern); + public RecruitmentExistsResponse checkRecruitmentExists(@RequestParam(value = "winter_intern") boolean winterIntern) { + boolean exists = checkRecruitmentExistsUseCase.execute(winterIntern); + return new RecruitmentExistsResponse(exists); } private List parseCodes(String jobCode, String techCodes) { From 090f2612592d80d84265e1bb776996ae987b09b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AA=85=EC=A7=84?= <4mj.eo@dsm.hs.kr> Date: Wed, 6 Nov 2024 23:07:09 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=9B=A0=20::=20(#834)=20response=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/RecruitmentExistsResponse.java | 4 +++- .../domain/recruitment/spi/QueryRecruitmentPort.java | 2 ++ .../usecase/CheckRecruitmentExistsUseCase.java | 5 +++-- .../persistence/RecruitmentPersistenceAdapter.java | 9 +++++++++ .../persistence/repository/RecruitmentJpaRepository.java | 1 - .../recruitment/presentation/RecruitmentWebAdapter.java | 5 ++--- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java index 50b8430a5..dd57f0818 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java @@ -9,5 +9,7 @@ @NoArgsConstructor(force = true) public class RecruitmentExistsResponse { - private boolean exists; + private boolean winterIntern; + + private boolean experiential; } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/QueryRecruitmentPort.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/QueryRecruitmentPort.java index 17110e817..30797799d 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/QueryRecruitmentPort.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/spi/QueryRecruitmentPort.java @@ -1,6 +1,7 @@ package team.retum.jobis.domain.recruitment.spi; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; +import team.retum.jobis.domain.recruitment.dto.response.RecruitmentExistsResponse; import team.retum.jobis.domain.recruitment.model.Recruitment; import team.retum.jobis.domain.recruitment.spi.vo.MyAllRecruitmentsVO; import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO; @@ -38,4 +39,5 @@ public interface QueryRecruitmentPort { List getRecent(); + RecruitmentExistsResponse existsByCompanyId(Long companyId); } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/CheckRecruitmentExistsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/CheckRecruitmentExistsUseCase.java index 4c7a1b039..056aa975b 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/CheckRecruitmentExistsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/usecase/CheckRecruitmentExistsUseCase.java @@ -3,6 +3,7 @@ import lombok.RequiredArgsConstructor; import team.retum.jobis.common.annotation.ReadOnlyUseCase; import team.retum.jobis.common.spi.SecurityPort; +import team.retum.jobis.domain.recruitment.dto.response.RecruitmentExistsResponse; import team.retum.jobis.domain.recruitment.spi.RecruitmentPort; @RequiredArgsConstructor @@ -12,8 +13,8 @@ public class CheckRecruitmentExistsUseCase { private final RecruitmentPort recruitmentPort; private final SecurityPort securityPort; - public boolean execute(boolean winterIntern) { + public RecruitmentExistsResponse execute() { Long companyId = securityPort.getCurrentCompany().getId(); - return recruitmentPort.existsByCompanyIdAndWinterIntern(companyId, winterIntern); + return recruitmentPort.existsByCompanyId(companyId); } } 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 478d4eae6..2583c2b4a 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 @@ -8,6 +8,7 @@ import team.retum.jobis.domain.application.model.ApplicationStatus; import team.retum.jobis.domain.application.persistence.entity.QApplicationEntity; import team.retum.jobis.domain.recruitment.dto.RecruitmentFilter; +import team.retum.jobis.domain.recruitment.dto.response.RecruitmentExistsResponse; import team.retum.jobis.domain.recruitment.exception.RecruitmentNotFoundException; import team.retum.jobis.domain.recruitment.model.RecruitStatus; import team.retum.jobis.domain.recruitment.model.Recruitment; @@ -401,6 +402,14 @@ public List getRecent() { return recruitmentJpaRepository.findByCreationDateBetween(oneDayAgo, now); } + @Override + public RecruitmentExistsResponse existsByCompanyId(Long companyId) { + boolean winterInternExists = recruitmentJpaRepository.existsByCompanyIdAndWinterIntern(companyId, true); + boolean experientialExists = recruitmentJpaRepository.existsByCompanyIdAndWinterIntern(companyId, false); + + return new RecruitmentExistsResponse(winterInternExists, experientialExists); + } + //===conditions===// private BooleanExpression eqYear(Integer year) { diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/RecruitmentJpaRepository.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/RecruitmentJpaRepository.java index edcb421c8..b7f134593 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/RecruitmentJpaRepository.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/repository/RecruitmentJpaRepository.java @@ -18,5 +18,4 @@ public interface RecruitmentJpaRepository extends JpaRepository findByCreationDateBetween(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate); - } 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 509fb58cd..e853326cb 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 @@ -254,9 +254,8 @@ public byte[] exportRecruitmentHistory(HttpServletResponse httpResponse) { } @GetMapping("/exists") - public RecruitmentExistsResponse checkRecruitmentExists(@RequestParam(value = "winter_intern") boolean winterIntern) { - boolean exists = checkRecruitmentExistsUseCase.execute(winterIntern); - return new RecruitmentExistsResponse(exists); + public RecruitmentExistsResponse checkRecruitmentExists() { + return checkRecruitmentExistsUseCase.execute(); } private List parseCodes(String jobCode, String techCodes) { From c0b42d826f168c0f57535be7482e3e5db6728522 Mon Sep 17 00:00:00 2001 From: "tae.y" <0211ilyoil@gmail.com> Date: Thu, 7 Nov 2024 08:36:51 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(836)=20=EB=94=94?= =?UTF-8?q?=EB=B0=94=EC=9D=B4=EC=8A=A4=20=ED=86=A0=ED=81=B0=20=ED=94=8C?= =?UTF-8?q?=EB=9E=AB=ED=8F=BC=20=ED=83=80=EC=9E=85=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobis/domain/student/usecase/StudentSignUpUseCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 74d429d91..50d704d33 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 @@ -6,6 +6,7 @@ import team.retum.jobis.domain.auth.dto.response.TokenResponse; import team.retum.jobis.domain.auth.model.AuthCode; import team.retum.jobis.domain.auth.model.Authority; +import team.retum.jobis.domain.auth.model.PlatformType; import team.retum.jobis.domain.auth.spi.JwtPort; import team.retum.jobis.domain.auth.spi.QueryAuthCodePort; import team.retum.jobis.domain.notification.spi.NotificationPort; @@ -70,7 +71,9 @@ public TokenResponse execute(StudentSignUpRequest request) { .build() ); - notificationPort.subscribeAllTopic(user); + if (request.platformType() != PlatformType.WEB) { + notificationPort.subscribeAllTopic(user); + } commandVerifiedStudentPort.deleteByGcnAndName( SchoolNumber.processSchoolNumber(student.getSchoolNumber()),