Skip to content

Commit

Permalink
πŸš€ :: 1.2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyoil2 committed Nov 6, 2024
2 parents 8e33b4e + 76b9284 commit b8fea3c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -38,4 +39,5 @@ public interface QueryRecruitmentPort {

List<Recruitment> getRecent();

RecruitmentExistsResponse existsByCompanyId(Long companyId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -401,6 +402,14 @@ public List<Recruitment> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ public interface RecruitmentJpaRepository extends JpaRepository<RecruitmentEntit

@Query("SELECT r FROM RecruitmentEntity r WHERE r.createdAt BETWEEN :startDate AND :endDate")
List<Recruitment> findByCreationDateBetween(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Long> parseCodes(String jobCode, String techCodes) {
Expand Down

0 comments on commit b8fea3c

Please sign in to comment.