From f26a92cba64591a00245cf3d213ae32bad5b259a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=A4=80?= <59381113+jjuny0310@users.noreply.github.com> Date: Thu, 16 Nov 2023 17:09:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=95=8C=EB=A6=BC=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=20read=20=ED=95=84=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 알림 조회 응답 데이터에 read 필드 추가 * test: 알림 조회 Controller 테스트 read 필드 추가 * docs: API 문서 최신화 --- .../dto/GetNotificationElement.java | 2 + src/main/resources/static/docs/index.html | 91 ++++++++++--------- .../NotificationControllerTest.java | 1 + 3 files changed, 52 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/ssafy/ssafsound/domain/notification/dto/GetNotificationElement.java b/src/main/java/com/ssafy/ssafsound/domain/notification/dto/GetNotificationElement.java index 8e2b6556..4e93254a 100644 --- a/src/main/java/com/ssafy/ssafsound/domain/notification/dto/GetNotificationElement.java +++ b/src/main/java/com/ssafy/ssafsound/domain/notification/dto/GetNotificationElement.java @@ -17,6 +17,7 @@ public class GetNotificationElement { private Long contentId; private ServiceType serviceType; private NotificationType notificationType; + private Boolean read; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createAt; @@ -28,6 +29,7 @@ public static GetNotificationElement from(Notification notification) { .contentId(notification.getContentId()) .serviceType(notification.getServiceType()) .notificationType(notification.getNotificationType()) + .read(notification.getRead()) .createAt(notification.getCreatedAt()) .build(); } diff --git a/src/main/resources/static/docs/index.html b/src/main/resources/static/docs/index.html index 2fae2e7b..bbab4ba2 100644 --- a/src/main/resources/static/docs/index.html +++ b/src/main/resources/static/docs/index.html @@ -772,7 +772,7 @@

@@ -13970,7 +13970,7 @@

@@ -14186,7 +14186,7 @@

@@ -14919,7 +14919,7 @@

구체적인 알림 타입, SYSTEM | POST_REPLAY | COMMENT_REPLAY | RECRUIT~ 단, RECRUIT는 추가될 수 있음.

+

data.notifications[].read

+

Boolean

+

새로 들어온 알림인지 여부, 처음 조회된 알림이면 false

+ +

data.notifications[].createAt

String

알림이 저장된 시간, yyyy-MM-dd HH:mm:ss

diff --git a/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java b/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java index 273df00e..83d66f29 100644 --- a/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java +++ b/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java @@ -54,6 +54,7 @@ void getNotificationsByCursor() { fieldWithPath("contentId").type(JsonFieldType.NUMBER).description("알림 클릭 시 이동할 해당 컨텐츠의 고유 ID, EX) ServiceType이 POST이면 게시글의 id, RECRUIT면 리쿠르트의 id 단, SYSTEM이면 null이 올 수도 있음."), fieldWithPath("serviceType").type(JsonFieldType.STRING).description("알림을 저장한 서비스 타입, SYSTEM | POST | RECRUIT"), fieldWithPath("notificationType").type(JsonFieldType.STRING).description("구체적인 알림 타입, SYSTEM | POST_REPLAY | COMMENT_REPLAY | RECRUIT~~~ 단, RECRUIT는 추가될 수 있음."), + fieldWithPath("read").type(JsonFieldType.BOOLEAN).description("새로 들어온 알림인지 여부, 처음 조회된 알림이면 false"), fieldWithPath("createAt").type(JsonFieldType.STRING).description("알림이 저장된 시간, yyyy-MM-dd HH:mm:ss") ) )