Skip to content

Commit

Permalink
[Server] 푸쉬 알림 목록 API 수정사항을 서버에 반영한다 (#184)
Browse files Browse the repository at this point in the history
* [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: 필요없는 코드 삭제

* [Server] 푸시 알림 리스트 목록 API mock data를 실제 데이터로 수정한다 (#183)

* Chore: Redis 설정 credentials 추가

* Fix: body 값 추가
  • Loading branch information
JeongHeumChoi authored Oct 3, 2024
1 parent 7616d4c commit 923aa7a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public class Notification {
@Column(name = "title")
private String title;

@Column(name = "body")
private String body;

@Column(name = "type")
private String type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public class NotificationCustomRepositoryImpl implements NotificationCustomRepos

@Override
public Page<NotificationProjection> findAllByUserId(Long userId, int limit, int offset, Pageable pageable) {
String query = "(SELECT id, title, type, is_checked, created_date " +
String query = "(SELECT id, title, body, type, is_checked, created_date " +
"FROM users_location_notification " +
"WHERE user_id = :userId) " +
"UNION ALL " +
"(SELECT id, title, type, is_checked, created_date " +
"(SELECT id, title, body, type, is_checked, created_date " +
"FROM category_notification " +
"WHERE user_id = :userId) " +
"ORDER BY created_date DESC " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
public record NotificationProjection(
Long id,
String title,
String body,
String type,
Boolean isChecked,
LocalDateTime createdDate
Expand All @@ -19,9 +20,10 @@ public static NotificationProjection of(
return NotificationProjection.builder()
.id(((Number) objects[0]).longValue())
.title((String) objects[1])
.type((String) objects[2])
.isChecked((Boolean) objects[3])
.createdDate(((Timestamp) objects[4]).toLocalDateTime())
.body((String) objects[2])
.type((String) objects[3])
.isChecked((Boolean) objects[4])
.createdDate(((Timestamp) objects[5]).toLocalDateTime())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ public class CategoryNotification extends Notification {
public static CategoryNotification createCategoryNotification(
final UserCategory userCategory,
final String title,
final String body,
final String type,
final Boolean isChecked,
final User user
) {
return CategoryNotification.builder()
.userCategory(userCategory)
.title(title)
.type(type)
.isChecked(isChecked)
.user(user)
.createdDate(LocalDateTime.now())
.build();
.userCategory(userCategory)
.title(title)
.body(body)
.type(type)
.isChecked(isChecked)
.user(user)
.createdDate(LocalDateTime.now())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ public class UserLocationNotification extends Notification {
public static UserLocationNotification createUserLocationNotification(
final UserLocation userLocation,
final String title,
final String body,
final String type,
final Boolean isChecked,
final User user
) {
return UserLocationNotification.builder()
.userLocation(userLocation)
.title(title)
.body(body)
.type(type)
.isChecked(isChecked)
.user(user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static NotificationResponseDto of(
return NotificationResponseDto.builder()
.id(notification.id())
.title(notification.title())
.body("야호")
.body(notification.body())
.type(notification.type())
.isChecked(notification.isChecked())
.createdDate(notification.createdDate())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public void sendCategoryNotification() {
= CategoryNotification.createCategoryNotification(
tempUserCategory,
title,
body,
NotificationConstants.CATEGORY_TYPE,
Boolean.FALSE,
user
Expand Down Expand Up @@ -123,6 +124,7 @@ public void sendUserLocationNotification() {
= UserLocationNotification.createUserLocationNotification(
tempUserLocation,
title,
body,
NotificationConstants.USER_LOCATION_TYPE,
Boolean.FALSE,
user
Expand Down

0 comments on commit 923aa7a

Please sign in to comment.