diff --git a/src/main/java/GraduationProject/TripPlannerZ/comment/CommentRepositoryImpl.java b/src/main/java/GraduationProject/TripPlannerZ/comment/CommentRepositoryImpl.java index 0a0a97d8..58d8a0fe 100644 --- a/src/main/java/GraduationProject/TripPlannerZ/comment/CommentRepositoryImpl.java +++ b/src/main/java/GraduationProject/TripPlannerZ/comment/CommentRepositoryImpl.java @@ -33,7 +33,7 @@ public List tripCommentsList(String tripUUID) { JPAExpressions .selectFrom(trip) .where(trip.UUID.eq(tripUUID)) - )) + ).and(comment.type.eq("Comment"))) .orderBy(comment.postDate.desc()) .fetch(); diff --git a/src/main/java/GraduationProject/TripPlannerZ/controller/TripController.java b/src/main/java/GraduationProject/TripPlannerZ/controller/TripController.java index 470ae77d..590880f8 100644 --- a/src/main/java/GraduationProject/TripPlannerZ/controller/TripController.java +++ b/src/main/java/GraduationProject/TripPlannerZ/controller/TripController.java @@ -151,7 +151,7 @@ public TripDetail getTripDetail(@PathVariable("id") Long id) { } // 여행 만든사람한테 알림 가게 - @GetMapping("/trip/requestAccompany") + @PostMapping("/trip/requestAccompany") public ResponseEntity requestAccompany(@RequestBody CommentPost commentPost) { System.out.println("tripUUID = " + commentPost.getTripUUID()); @@ -183,7 +183,11 @@ public ResponseEntity requestAccompany(@RequestBody CommentPost commentP commentService.saveComment(comment); - sseEmitterService.sendRequest(creater, emitter, comment); + TripComment tripComment = TripComment.builder() + .comment(comment) + .build(); + + sseEmitterService.sendRequest(creater, emitter, tripComment); return ResponseEntity.ok().body("true"); } diff --git a/src/main/java/GraduationProject/TripPlannerZ/sseEmitter/SseEmitterService.java b/src/main/java/GraduationProject/TripPlannerZ/sseEmitter/SseEmitterService.java index 8ac76fcf..5e8b6d12 100644 --- a/src/main/java/GraduationProject/TripPlannerZ/sseEmitter/SseEmitterService.java +++ b/src/main/java/GraduationProject/TripPlannerZ/sseEmitter/SseEmitterService.java @@ -107,10 +107,10 @@ public void sendNotificationToMembersInParty(List receiver, Comment Member m = receivedMember.getMember(); // 알림 저장 및 알림 전송 - Notification notification = Notification.builder() - .comment(comment) - .member(m) - .build(); +// Notification notification = Notification.builder() +// .comment(comment) +// .member(m) +// .build(); // notificationService.saveNotification(notification); Long id = m.getId();