Skip to content

Commit ed81cf7

Browse files
committed
refactor(recruit-board): 메서드명 명확하게 변경
1 parent 28e808b commit ed81cf7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/main/java/com/somemore/domains/recruitboard/repository/RecruitBoardRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public interface RecruitBoardRepository {
3434

3535
List<RecruitBoard> findAll();
3636

37-
long updateRecruitingToClosedByStartDate(LocalDateTime startTime, LocalDateTime endTime);
37+
long updateStatusToClosedForDateRange(LocalDateTime startTime, LocalDateTime endTime);
3838

39-
long updateClosedToCompletedByEndDate(LocalDateTime startTime, LocalDateTime endTime);
39+
long updateStatusToCompletedForDateRange(LocalDateTime startTime, LocalDateTime endTime);
4040

4141
// Page<RecruitBoardDetail> findAllNearbyWithKeyword(RecruitBoardNearByCondition condition);
4242
// Page<RecruitBoardWithCenter> findByRecruitBoardsContaining(RecruitBoardSearchCondition condition);

src/main/java/com/somemore/domains/recruitboard/repository/RecruitBoardRepositoryImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public List<RecruitBoard> findAll() {
210210
}
211211

212212
@Override
213-
public long updateRecruitingToClosedByStartDate(LocalDateTime startTime,
213+
public long updateStatusToClosedForDateRange(LocalDateTime startTime,
214214
LocalDateTime endTime) {
215215
return queryFactory.update(recruitBoard)
216216
.set(recruitBoard.recruitStatus, CLOSED)
@@ -223,7 +223,7 @@ public long updateRecruitingToClosedByStartDate(LocalDateTime startTime,
223223
}
224224

225225
@Override
226-
public long updateClosedToCompletedByEndDate(LocalDateTime startTime, LocalDateTime endTime) {
226+
public long updateStatusToCompletedForDateRange(LocalDateTime startTime, LocalDateTime endTime) {
227227
return queryFactory.update(recruitBoard)
228228
.set(recruitBoard.recruitStatus, COMPLETED)
229229
.where(

src/main/java/com/somemore/domains/recruitboard/scheduler/RecruitBoardStatusUpdateScheduler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void updateRecruitBoardStatusToClosed() {
3232
LocalDateTime tomorrow = today.plusDays(1);
3333

3434
try {
35-
long updatedCount = recruitBoardRepository.updateRecruitingToClosedByStartDate(
35+
long updatedCount = recruitBoardRepository.updateStatusToClosedForDateRange(
3636
today, tomorrow);
3737
log.info("총 {}개의 모집글 상태를 CLOSED로 변경 완료", updatedCount);
3838
} catch (Exception e) {
@@ -53,7 +53,7 @@ public void updateRecruitBoardStatusToCompleted() {
5353
LocalDateTime yesterday = today.minusDays(1);
5454

5555
try {
56-
long updatedCount = recruitBoardRepository.updateClosedToCompletedByEndDate(yesterday, today);
56+
long updatedCount = recruitBoardRepository.updateStatusToCompletedForDateRange(yesterday, today);
5757
log.info("총 {}개의 모집글 상태를 COMPLETED로 변경 완료", updatedCount);
5858
} catch (Exception e) {
5959
log.error("봉사 종료일이 지난 모집글 상태를 COMPLETED로 변경하는 중 오류 발생", e);

src/test/java/com/somemore/domains/recruitboard/repository/RecruitBoardRepositoryImplTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ void findAllByIds() {
390390

391391
@DisplayName("봉사 시작일 기준으로 모집중 상태 게시글을 모집 완료로 변경한다")
392392
@Test
393-
void updateRecruitingToClosedByStartDate() {
393+
void updateStatusToClosedForDateRange() {
394394
// given
395395
LocalDateTime today = LocalDateTime.of(2024, 1, 1, 0, 0); // 2024-01-01 00:00:00
396396
LocalDateTime startDateTime = today.plusHours(12); // 2024-01-01 12:00:00
@@ -402,7 +402,7 @@ void updateRecruitingToClosedByStartDate() {
402402
recruitBoardRepository.saveAll(List.of(boardOne, boardTwo));
403403

404404
// when
405-
long updateCnt = recruitBoardRepository.updateRecruitingToClosedByStartDate(today, tomorrow);
405+
long updateCnt = recruitBoardRepository.updateStatusToClosedForDateRange(today, tomorrow);
406406
em.clear();
407407

408408
// then
@@ -415,7 +415,7 @@ void updateRecruitingToClosedByStartDate() {
415415

416416
@DisplayName("봉사 종료일 기준으로 모집완료 상태 게시글을 종료로 변경한다")
417417
@Test
418-
void updateClosedToCompletedByEndDate() {
418+
void updateStatusToCompletedForDateRange() {
419419
// given
420420
LocalDateTime now = LocalDateTime.of(2024, 1, 2, 0, 0); // 2024-01-02 00:00:00
421421
LocalDateTime yesterday = now.minusDays(1); // 2024-01-01 00:00:00
@@ -427,7 +427,7 @@ void updateClosedToCompletedByEndDate() {
427427
recruitBoardRepository.saveAll(List.of(boardOne, boardTwo));
428428

429429
// when
430-
long updateCnt = recruitBoardRepository.updateClosedToCompletedByEndDate(yesterday, now);
430+
long updateCnt = recruitBoardRepository.updateStatusToCompletedForDateRange(yesterday, now);
431431
em.clear();
432432

433433
// then

0 commit comments

Comments
 (0)