File tree Expand file tree Collapse file tree
src/main/java/Mua/Mua_backend/domain/notification/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package Mua .Mua_backend .domain .notification .controller ;
22
33import Mua .Mua_backend .domain .member .entity .Member ;
4+ import Mua .Mua_backend .domain .notification .controller .docs .NotificationControllerDocs ;
45import Mua .Mua_backend .domain .notification .dto .response .NotificationResponse ;
56import Mua .Mua_backend .domain .notification .service .NotificationService ;
67import lombok .RequiredArgsConstructor ;
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
Original file line number Diff line number Diff line change 1717import org .springframework .security .core .annotation .AuthenticationPrincipal ;
1818import org .springframework .web .bind .annotation .DeleteMapping ;
1919import org .springframework .web .bind .annotation .GetMapping ;
20+ import org .springframework .web .bind .annotation .PatchMapping ;
21+ import org .springframework .web .bind .annotation .PathVariable ;
2022
2123import 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 = """
You can’t perform that action at this time.
0 commit comments