Skip to content

Commit

Permalink
Merge pull request #726 from GraudationProject2023/main
Browse files Browse the repository at this point in the history
Server Request
  • Loading branch information
Lee-Dongwook authored Sep 24, 2023
2 parents c184fbf + 8ec093d commit 8b6afc6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public List<TripComment> tripCommentsList(String tripUUID) {
JPAExpressions
.selectFrom(trip)
.where(trip.UUID.eq(tripUUID))
))
).and(comment.type.eq("Comment")))
.orderBy(comment.postDate.desc())
.fetch();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public TripDetail getTripDetail(@PathVariable("id") Long id) {
}

// 여행 만든사람한테 알림 가게
@GetMapping("/trip/requestAccompany")
@PostMapping("/trip/requestAccompany")
public ResponseEntity<String> requestAccompany(@RequestBody CommentPost commentPost) {

System.out.println("tripUUID = " + commentPost.getTripUUID());
Expand Down Expand Up @@ -183,7 +183,11 @@ public ResponseEntity<String> 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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ public void sendNotificationToMembersInParty(List<MemberParty> 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();
Expand Down

0 comments on commit 8b6afc6

Please sign in to comment.