-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Server] 명소 리마인드 푸쉬 알림 스케쥴링을 구현을 서버에 반영한다 (#181)
* [Server] 테스트 푸시 API 수정 내용 서버 반영 (#175) * Chore: Redis 설정 credentials 추가 * Fix: 푸시 알림 테스트 계정 연결 * [Server] 카테고리 리마인드 푸쉬 알림 스케쥴링을 구현한다 (#177) * Chore: Redis 설정 credentials 추가 * Feat: UserCategory 푸시 알림 구현 * [Server] 명소 리마인드 푸쉬 알림 스케쥴링을 구현한다 (#180) * Chore: Redis 설정 credentials 추가 * Refactor: 필요없는 코드 삭제 * Refactor: 로그 추가 * Feat: 명소 리마인드 알림 기능 구현 * Feat: 알림 저장 로직 구현 * Refactor: 로그 삭제 * Refactor: 필요없는 코드 삭제
- Loading branch information
1 parent
fabd355
commit 7616d4c
Showing
13 changed files
with
221 additions
and
14 deletions.
There are no files selected for viewing
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
9 changes: 9 additions & 0 deletions
9
...main/java/Skeep/backend/location/userLocation/domain/UserLocationRecommendProjection.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package Skeep.backend.location.userLocation.domain; | ||
|
||
import java.time.LocalDate; | ||
|
||
public interface UserLocationRecommendProjection { | ||
Long getUserLocationId(); | ||
String getLocationPlaceName(); | ||
LocalDate getWeatherDate(); | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/java/Skeep/backend/notification/constant/NotificationConstants.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package Skeep.backend.notification.constant; | ||
|
||
public class NotificationConstants { | ||
public static String USER_LOCATION_TYPE = "userLocation"; | ||
public static String CATEGORY_TYPE = "category"; | ||
} |
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
16 changes: 16 additions & 0 deletions
16
...va/Skeep/backend/notification/service/CategoryNotification/CategoryNotificationSaver.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package Skeep.backend.notification.service.CategoryNotification; | ||
|
||
import Skeep.backend.notification.domain.CategoryNotification.CategoryNotification; | ||
import Skeep.backend.notification.domain.CategoryNotification.CategoryNotificationRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class CategoryNotificationSaver { | ||
private final CategoryNotificationRepository categoryNotificationRepository; | ||
|
||
public void save(CategoryNotification categoryNotification) { | ||
categoryNotificationRepository.save(categoryNotification); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/Skeep/backend/notification/service/NotificationSaver.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package Skeep.backend.notification.service; | ||
|
||
import Skeep.backend.notification.domain.CategoryNotification.CategoryNotification; | ||
import Skeep.backend.notification.domain.UserLocationNotification.UserLocationNotification; | ||
import Skeep.backend.notification.service.CategoryNotification.CategoryNotificationSaver; | ||
import Skeep.backend.notification.service.UserLocationNotification.UserLocationNotificationSaver; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class NotificationSaver { | ||
private final UserLocationNotificationSaver userLocationNotificationSaver; | ||
private final CategoryNotificationSaver categoryNotificationSaver; | ||
|
||
@Transactional | ||
public void saveNotification(Object notification) { | ||
if (notification instanceof UserLocationNotification) | ||
userLocationNotificationSaver.save((UserLocationNotification) notification); | ||
else if (notification instanceof CategoryNotification) | ||
categoryNotificationSaver.save((CategoryNotification) notification); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
.../backend/notification/service/UserLocationNotification/UserLocationNotificationSaver.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package Skeep.backend.notification.service.UserLocationNotification; | ||
|
||
import Skeep.backend.notification.domain.UserLocationNotification.UserLocationNotification; | ||
import Skeep.backend.notification.domain.UserLocationNotification.UserLocationNotificationRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class UserLocationNotificationSaver { | ||
private final UserLocationNotificationRepository userLocationNotificationRepository; | ||
|
||
public void save(UserLocationNotification userLocationNotification) { | ||
userLocationNotificationRepository.save(userLocationNotification); | ||
} | ||
} |