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..dd57f0818 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/recruitment/dto/response/RecruitmentExistsResponse.java @@ -0,0 +1,15 @@ +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 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-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()), 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 fb22b34eb..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 @@ -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,8 @@ public byte[] exportRecruitmentHistory(HttpServletResponse httpResponse) { } @GetMapping("/exists") - public boolean checkRecruitmentExists(@RequestParam(value = "winter_intern") Boolean winterIntern) { - return checkRecruitmentExistsUseCase.execute(winterIntern); + public RecruitmentExistsResponse checkRecruitmentExists() { + return checkRecruitmentExistsUseCase.execute(); } private List parseCodes(String jobCode, String techCodes) {