1. 나의 알림 목록[GET]
/notifications
Request
{ header: { Authorization: 'baerer JWT token' } }
Response
[ // Notification Array { "seen": Boolean, "_id": String, "author": User, "user": User | String, "post": Nullable<String>, // 포스트 id "follow": Optional<String>, // 사용자 id "comment": Optional<Comment>, "message": Optional<String>, // 메시지 id "createdAt": String, "updatedAt": String, // notificationType 어디갔지? } ]
2. 알림 읽음 처리[GET]
/notifications/seen
Request
{ header: { Authorization: 'baerer JWT token' } }
Response
3. 알림 생성[POST]
/notifications/create
Request
{ header: { Authorization: 'baerer JWT token' }, body: { notificationType: "COMMENT"|"FOLLOW"|"LIKE"|"MESSAGE", notificationTypeId: String -> 조건 { COMMENT일 경우: 댓글 id, FOLLOW일 경우: 팔로우 id, LIKE일 경우: 좋아요 id, MESSAGE일 경우: 메세지 id }, userId: String, postId: Nullable<String> // type이 FOLLOW인 경우에는 Null } }
Response
{ // Notification Object "seen": Boolean, "_id": String, "author": User, "user": User | String, "post": Nullable<String>, // 포스트 id "follow": Optional<String>, // 사용자 id "comment": Optional<Comment>, "message": Optional<String>, // 메시지 id "createdAt": String, "updatedAt": String, // notificationType 어디갔지? }