Skip to content

Commit 8e96f62

Browse files
committed
[#71] Refactor: NotificationControllerDocs 수정
1 parent 87be252 commit 8e96f62

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

src/main/java/Mua/Mua_backend/domain/notification/controller/NotificationController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package Mua.Mua_backend.domain.notification.controller;
22

33
import Mua.Mua_backend.domain.member.entity.Member;
4+
import Mua.Mua_backend.domain.notification.controller.docs.NotificationControllerDocs;
45
import Mua.Mua_backend.domain.notification.dto.response.NotificationResponse;
56
import Mua.Mua_backend.domain.notification.service.NotificationService;
67
import lombok.RequiredArgsConstructor;
@@ -13,7 +14,7 @@
1314
@RestController
1415
@RequiredArgsConstructor
1516
@RequestMapping("/api/notifications")
16-
public class NotificationController {
17+
public class NotificationController implements NotificationControllerDocs {
1718

1819
private final NotificationService notificationService;
1920

src/main/java/Mua/Mua_backend/domain/notification/controller/docs/NotificationControllerDocs.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import org.springframework.security.core.annotation.AuthenticationPrincipal;
1818
import org.springframework.web.bind.annotation.DeleteMapping;
1919
import org.springframework.web.bind.annotation.GetMapping;
20+
import org.springframework.web.bind.annotation.PatchMapping;
21+
import org.springframework.web.bind.annotation.PathVariable;
2022

2123
import java.util.List;
2224

@@ -71,6 +73,31 @@ List<NotificationResponse> getMyNotifications(
7173
);
7274

7375

76+
@Operation(
77+
summary = "알림 읽음 처리",
78+
description = """
79+
특정 알림을 읽음 상태로 변경합니다.
80+
81+
- 이미 읽은 알림이어도 요청은 정상 처리됩니다.
82+
- 성공 시 200 OK를 반환합니다.
83+
"""
84+
)
85+
@ApiResponses({
86+
@ApiResponse(
87+
responseCode = "200",
88+
description = "알림 읽음 처리 성공"
89+
)
90+
})
91+
@PatchMapping("/{notificationId}/read")
92+
ResponseEntity<Void> readNotification(
93+
@Parameter(description = "읽음 처리할 알림 ID", example = "1")
94+
@PathVariable Long notificationId,
95+
96+
@Parameter(hidden = true)
97+
@AuthenticationPrincipal Member member
98+
);
99+
100+
74101
@Operation(
75102
summary = "내 알림 전체 삭제",
76103
description = """

0 commit comments

Comments
 (0)