diff --git a/core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java b/core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java index fbaa2ab3..e32757bf 100644 --- a/core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java +++ b/core/src/main/java/com/mailsangja/core/controller/docs/LabelControllerDocs.java @@ -28,7 +28,7 @@ public interface LabelControllerDocs { @Operation( summary = "라벨 목록 조회", - description = "로그인한 사용자의 활성 라벨 목록을 displayOrder ASC 정렬로 반환합니다. 라벨별 읽지 않은 스레드 수와 민감 라벨 여부를 포함합니다.", + description = "로그인한 사용자의 활성 라벨 목록을 displayOrder ASC 정렬로 반환합니다. 라벨별 알림 정책, 읽지 않은 스레드 수와 민감 라벨 여부를 포함합니다.", security = @SecurityRequirement(name = "cookieAuth") ) @ApiResponses({ diff --git a/core/src/main/java/com/mailsangja/core/dto/label/LabelListResponse.java b/core/src/main/java/com/mailsangja/core/dto/label/LabelListResponse.java index 52f0e192..9a591a5e 100644 --- a/core/src/main/java/com/mailsangja/core/dto/label/LabelListResponse.java +++ b/core/src/main/java/com/mailsangja/core/dto/label/LabelListResponse.java @@ -1,5 +1,6 @@ package com.mailsangja.core.dto.label; +import com.mailsangja.db.common.label.NotificationPolicy; import com.mailsangja.db.entity.label.Label; import io.swagger.v3.oas.annotations.media.Schema; @@ -19,6 +20,9 @@ public record LabelListResponse( @Schema(description = "표시 순서", example = "0") int order, + @Schema(description = "알림 정책 (URGENT/INHERIT/SILENT)", example = "INHERIT") + NotificationPolicy notificationPolicy, + @Schema(description = "AI 기능에서 제외할 민감 라벨 여부", example = "false") boolean isSensitive, @@ -32,6 +36,7 @@ public static LabelListResponse of(Label label, long unreadThreadCount) { label.getName(), label.getColorCode(), label.getDisplayOrder(), + label.getNotificationPolicy(), label.isSensitive(), unreadThreadCount ); diff --git a/core/src/test/java/com/mailsangja/core/facade/LabelFacadeTest.java b/core/src/test/java/com/mailsangja/core/facade/LabelFacadeTest.java index df3eac1d..4eb9d879 100644 --- a/core/src/test/java/com/mailsangja/core/facade/LabelFacadeTest.java +++ b/core/src/test/java/com/mailsangja/core/facade/LabelFacadeTest.java @@ -68,8 +68,8 @@ class LabelFacadeTest { @Test void 라벨목록조회_미읽은스레드수매핑및누락시_0반환() { User user = user(); - Label first = label("업무", 1); - Label second = label("개인", 2); + Label first = label("업무", 1, null, NotificationPolicy.URGENT); + Label second = label("개인", 2, null, NotificationPolicy.SILENT); when(labelQueryService.findAllActiveByUserId(user.getId())).thenReturn(List.of(first, second)); when(labelQueryService.findUnreadThreadCountsByUserId(user.getId())).thenReturn(Map.of(first.getId(), 7L)); @@ -77,9 +77,11 @@ class LabelFacadeTest { assertEquals(2, responses.size()); assertEquals(first.getId(), responses.get(0).id()); + assertEquals(NotificationPolicy.URGENT, responses.get(0).notificationPolicy()); assertEquals(first.isSensitive(), responses.get(0).isSensitive()); assertEquals(7L, responses.get(0).unreadThreadCount()); assertEquals(second.getId(), responses.get(1).id()); + assertEquals(NotificationPolicy.SILENT, responses.get(1).notificationPolicy()); assertEquals(second.isSensitive(), responses.get(1).isSensitive()); assertEquals(0L, responses.get(1).unreadThreadCount()); } @@ -307,11 +309,15 @@ private Label label(String name, int order) { } private Label label(String name, int order, LabelRule rule) { + return label(name, order, rule, NotificationPolicy.INHERIT); + } + + private Label label(String name, int order, LabelRule rule, NotificationPolicy notificationPolicy) { return Label.builder() .id(UUID.randomUUID()) .name(name) .colorCode("#3366FF") - .notificationPolicy(NotificationPolicy.INHERIT) + .notificationPolicy(notificationPolicy) .displayOrder(order) .rule(rule) .build();