Skip to content

Commit

Permalink
๐Ÿ›  :: (#830) ๊ฒจ์šธ์ธํ„ด ์—ฌ๋ถ€๋กœ ํ™•์ธ
Browse files Browse the repository at this point in the history
  • Loading branch information
4mjeo committed Nov 6, 2024
1 parent 247de68 commit db635dc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ public interface QueryRecruitmentPort {

List<Recruitment> getRecent();

boolean existsByCompanyId(Long companyId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CheckRecruitmentExistsUseCase {

private final RecruitmentPort recruitmentPort;

public boolean execute(Long companyId) {
return recruitmentPort.existsByCompanyId(companyId);
public boolean execute(Long companyId, boolean winterIntern) {
return recruitmentPort.existsByCompanyIdAndWinterIntern(companyId, winterIntern);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public List<Recruitment> getAllByIdInOrThrow(List<Long> recruitmentIds) {

@Override
public boolean existsByCompanyIdAndWinterIntern(Long companyId, boolean winterIntern) {
return recruitmentJpaRepository.existsByCompanyIdAndStatusNotAndWinterIntern(companyId, RecruitStatus.DONE, winterIntern);
return recruitmentJpaRepository.existsByCompanyIdAndWinterIntern(companyId, winterIntern);
}

@Override
Expand Down Expand Up @@ -401,11 +401,6 @@ public List<Recruitment> getRecent() {
return recruitmentJpaRepository.findByCreationDateBetween(oneDayAgo, now);
}

@Override
public boolean existsByCompanyId(Long companyId) {
return recruitmentJpaRepository.existsByCompanyId(companyId);
}

//===conditions===//

private BooleanExpression eqYear(Integer year) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface RecruitmentJpaRepository extends JpaRepository<RecruitmentEntit

List<RecruitmentEntity> findByIdIn(List<Long> recruitmentIds);

boolean existsByCompanyIdAndStatusNotAndWinterIntern(Long companyId, RecruitStatus status, boolean winterIntern);
boolean existsByCompanyIdAndWinterIntern(Long companyId, boolean winterIntern);

@Query("SELECT r FROM RecruitmentEntity r WHERE r.createdAt BETWEEN :startDate AND :endDate")
List<Recruitment> findByCreationDateBetween(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,11 @@ public byte[] exportRecruitmentHistory(HttpServletResponse httpResponse) {
}

@GetMapping("/exists/{company-id}")
public boolean checkRecruitmentExists(@PathVariable("company-id") Long companyId) {
return checkRecruitmentExistsUseCase.execute(companyId);
public boolean checkRecruitmentExists(
@PathVariable("company-id") Long companyId,
@RequestParam(value = "winter_intern") Boolean winterIntern
) {
return checkRecruitmentExistsUseCase.execute(companyId, winterIntern);
}

private List<Long> parseCodes(String jobCode, String techCodes) {
Expand Down

0 comments on commit db635dc

Please sign in to comment.