Skip to content

Commit 08e7531

Browse files
committed
refactor(recruit-board): sonarqube 이슈 해결
1 parent bb0fca1 commit 08e7531

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

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

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

212212
@Override
213-
public long updateRecruitingToClosedByStartDate(LocalDateTime startTime, LocalDateTime endTime) {
214-
BooleanExpression exp = statusEq(RECRUITING)
215-
.and(volunteerStartDateTimeBetween(startTime, endTime));
216-
213+
public long updateRecruitingToClosedByStartDate(LocalDateTime startTime,
214+
LocalDateTime endTime) {
217215
return queryFactory.update(recruitBoard)
218216
.set(recruitBoard.recruitStatus, CLOSED)
219-
.where(exp)
217+
.where(
218+
statusEq(RECRUITING),
219+
volunteerStartDateTimeBetween(startTime, endTime),
220+
isNotDeleted()
221+
)
220222
.execute();
221223
}
222224

223225
@Override
224226
public long updateClosedToCompletedByEndDate(LocalDateTime now) {
225-
BooleanExpression exp = statusEq(CLOSED)
226-
.and(volunteerEndDateTimeBefore(now));
227-
228227
return queryFactory.update(recruitBoard)
229228
.set(recruitBoard.recruitStatus, COMPLETED)
230-
.where(exp)
229+
.where(
230+
statusEq(CLOSED),
231+
volunteerEndDateTimeBefore(now),
232+
isNotDeleted()
233+
)
231234
.execute();
232235
}
233236

0 commit comments

Comments
 (0)