-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] 브리핑 보드 알람 타임라인 정렬 에러 해결 (#168)
* [FIX] 쿼리 조건 간단화 및 cross join 방지 * [FIX] cross join 방지 및 미션 기록 생성일자로 정렬 순서 변경 * #133 [refactor, feat] 개인/그룹 알람 목록 가져오기 쿼리를 동적으로 생성 및 활성화 알람을 상단으로 표시하기 * #133 [feat] 알람 목록 쿼리 조건 메서드 분리 및 alarm type 에러 처리 세분화 * #133 [refactor] 필요없는 주석 제거 * #133 [FIX] 알람 활성화 여부에 따른 정렬 삭제
- Loading branch information
Showing
7 changed files
with
58 additions
and
33 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/com/wakeUpTogetUp/togetUp/api/alarm/domain/AlarmType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
package com.wakeUpTogetUp.togetUp.api.alarm.domain; | ||
|
||
import com.wakeUpTogetUp.togetUp.common.Status; | ||
import com.wakeUpTogetUp.togetUp.exception.BaseException; | ||
import java.util.Arrays; | ||
|
||
public enum AlarmType { | ||
PERSONAL, | ||
GROUP; | ||
|
||
public static AlarmType getByName(String name) { | ||
return Arrays.stream(values()) | ||
.filter(value -> value.name().equals(name)) | ||
.findFirst() | ||
.orElseThrow( | ||
() -> new BaseException(Status.ALARM_TYPE_NOT_FOUND) | ||
); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/wakeUpTogetUp/togetUp/api/alarm/repository/AlarmQueryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package com.wakeUpTogetUp.togetUp.api.alarm.repository; | ||
|
||
import com.wakeUpTogetUp.togetUp.api.alarm.controller.dto.response.AlarmSimpleRes; | ||
import com.wakeUpTogetUp.togetUp.api.alarm.domain.AlarmType; | ||
import com.wakeUpTogetUp.togetUp.api.alarm.model.Alarm; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
public interface AlarmQueryRepository { | ||
|
||
List<AlarmSimpleRes> findAllUserTodayActiveAlarmsAfterNow(Integer userId, LocalDateTime now); | ||
|
||
List<Alarm> findUserAlarmsByType(Integer userId, AlarmType type); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters