Skip to content

Commit 2fa9e9d

Browse files
authored
fix: 알림 관련 에러 일부 수정 (#58)
* fix: 알림 읽기 응답값을 200에서 204로 변경 * feat: 알림 메시지 일부 변경
1 parent 5790ce6 commit 2fa9e9d

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/main/java/swyp/dodream/domain/notification/controller/NotificationController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import swyp.dodream.domain.notification.repository.NotificationRepository;
1212
import swyp.dodream.domain.notification.service.NotificationService;
1313
import swyp.dodream.jwt.dto.UserPrincipal;
14+
import org.springframework.http.ResponseEntity;
1415

1516
import java.util.List;
1617

@@ -53,10 +54,11 @@ public List<Notification> list(Authentication authentication) {
5354
)
5455
@PreAuthorize("isAuthenticated()")
5556
@PostMapping("/{id}/read")
56-
public void read(@PathVariable Long id, Authentication authentication) {
57+
public ResponseEntity<Void> read(@PathVariable Long id, Authentication authentication) {
5758
UserPrincipal principal = (UserPrincipal) authentication.getPrincipal();
5859
Long userId = principal.getUserId();
5960
notificationService.markAsRead(id, userId);
61+
return ResponseEntity.status(204).build();
6062
}
6163

6264
@Operation(

src/main/java/swyp/dodream/domain/notification/service/NotificationService.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void sendProposalNotificationToUser(Long receiverId, Long postId, String
3434
}
3535

3636
Long id = snowflakeIdService.generateId();
37-
String msg = leaderName + "님이 제안을 보냈습니다. " + "\'" + postTitle + "\'로 이동하여 지원을 하시면 매칭이 가능합니다.";
37+
String msg = leaderName + "님에게서 " + "[" + postTitle + "] 지원 제안이 도착했어요";
3838

3939
Notification notification = new Notification(
4040
id,
@@ -81,7 +81,7 @@ public void sendProposalAppliedNotification(Long leaderId, Long postId, String a
8181
if (exists) return;
8282

8383
Long id = snowflakeIdService.generateId();
84-
String msg = "이전에 제안했던 " + applicantName + "님이 '" + postTitle + "'에 지원했습니다.";
84+
String msg = "지원 제안했던 " + applicantName + "님이 [" + postTitle + "]에 지원했어요";
8585

8686
Notification notification = new Notification(
8787
id,
@@ -114,7 +114,7 @@ public void sendApplicationAcceptedToApplicant(Long applicantId,
114114
if (exists) return;
115115

116116
Long id = snowflakeIdService.generateId();
117-
String msg = leaderName + "님이 '" + postTitle + "' 지원을 수락했어요.";
117+
String msg = "[" + postTitle + "] 매칭이 완료되었어요";
118118

119119
Notification notification = new Notification(
120120
id,
@@ -145,7 +145,7 @@ public void sendApplicationAcceptedToLeader(Long leaderId,
145145
if (exists) return;
146146

147147
Long id = snowflakeIdService.generateId();
148-
String msg = applicantName + "님과 매칭이 완료됐어요.";
148+
String msg = applicantName + "님과 매칭이 완료되었어요";
149149

150150
Notification notification = new Notification(
151151
id,
@@ -169,7 +169,7 @@ public void sendApplicationAcceptedToLeader(Long leaderId,
169169
public void sendFeedbackWrittenNotification(Long receiverId, Long postId, String postTitle) {
170170

171171
Long id = snowflakeIdService.generateId();
172-
String msg = "익명의 팀원이 '" + postTitle + "'에 피드백을 작성했습니다.";
172+
String msg = "[" + postTitle + "] 함께한 팀원이 회원님에게 새로운 후기를 남겼어요";
173173

174174
Notification notification = new Notification(
175175
id,
@@ -198,7 +198,7 @@ public void sendBookmarkDeadlineNotification(Long receiverId, Long postId, Strin
198198
if (exists) return;
199199

200200
Long id = snowflakeIdService.generateId();
201-
String msg = "북마크 해둔 '" + postTitle + "' 모집글이 오늘 마감됩니다. 잊지말고 확인해보세요!";
201+
String msg = "북마크하신 [" + postTitle + "] 모집이 오늘 마감돼요";
202202

203203
Notification notification = new Notification(
204204
id,
@@ -226,7 +226,7 @@ public void sendReviewActivated(Long receiverId, Long postId, String postTitle)
226226
if (exists) return;
227227

228228
Long id = snowflakeIdService.generateId();
229-
String msg = "'" + postTitle + "' 모집글에 대한 팀원 피드백을 오늘부터 작성할 수 있어요.";
229+
String msg = "함께 활동한 [" + postTitle + "] 팀원에 대한 후기를 작성해주세요";
230230

231231
Notification notification = new Notification(
232232
id,

0 commit comments

Comments
 (0)