From 826801a00907145a301478576d69ae7a2b85d487 Mon Sep 17 00:00:00 2001 From: duddn2012 <31121731+duddn2012@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:29:37 +0900 Subject: [PATCH] refactor/comment notice (#138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * House Save 시 Point 처리 * #16 House Save 시 Point 처리 * #45 update user-fee api * #54 이달의 관리비 조회 * #72 이달의 관리비 조회(위젯 또는 하단 탭 접근) * #72 UserFee field nullable 처리 * #72 UserFee API 수정 * #80 이달의 관리비 수정 API * #80 피드백 반영 * conflict 해결 * #88 update user and mypage api * #89 MyPage 사용자 게시물 조회 API * #109 커뮤니티 등록 API 수정 * #116 Get House API * 137 유저 알림 API 조건부 호출 * #137 유저 알림 API 조건부 호출 피드백 적용 --- .../example/hello_there/comment/CommentController.java | 1 + .../com/example/hello_there/comment/CommentService.java | 8 ++++++++ .../java/com/example/hello_there/login/jwt/Secret.java | 7 +++++++ 3 files changed, 16 insertions(+) create mode 100644 src/main/java/com/example/hello_there/login/jwt/Secret.java diff --git a/src/main/java/com/example/hello_there/comment/CommentController.java b/src/main/java/com/example/hello_there/comment/CommentController.java index bd06643..e144a85 100644 --- a/src/main/java/com/example/hello_there/comment/CommentController.java +++ b/src/main/java/com/example/hello_there/comment/CommentController.java @@ -4,6 +4,7 @@ import com.example.hello_there.exception.BaseException; import com.example.hello_there.exception.BaseResponse; import com.example.hello_there.login.jwt.JwtService; +import com.example.hello_there.notice.NoticeService; import com.example.hello_there.user.UserRepository; import com.example.hello_there.utils.UtilService; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/example/hello_there/comment/CommentService.java b/src/main/java/com/example/hello_there/comment/CommentService.java index 145b084..f196678 100644 --- a/src/main/java/com/example/hello_there/comment/CommentService.java +++ b/src/main/java/com/example/hello_there/comment/CommentService.java @@ -6,6 +6,7 @@ import com.example.hello_there.comment.likecomment.LikeComment; import com.example.hello_there.comment.likecomment.LikeCommentRepository; import com.example.hello_there.exception.BaseException; +import com.example.hello_there.notice.NoticeService; import com.example.hello_there.report.Report; import com.example.hello_there.report.ReportRepository; import com.example.hello_there.report.ReportService; @@ -38,6 +39,7 @@ public class CommentService { private final ReportService reportService; private final UtilService utilService; private final SQSService sqsService; + private final NoticeService noticeService; /** @@ -66,6 +68,9 @@ public PostCommentRes addComment(Long boardId, Long userId, Long parentId,PostCo comment.addGroupId(groupId + 1L); Comment savedParentComment = commentRepository.save(comment); // 부모 댓글 저장 + if(board.getUser().getId() != userId) { + noticeService.sendCommentNotification(savedParentComment.getCommentId()); + } return new PostCommentRes(savedParentComment); } else { parentComment = commentRepository.findById(parentId) @@ -76,6 +81,9 @@ public PostCommentRes addComment(Long boardId, Long userId, Long parentId,PostCo Comment savedChildComment = commentRepository.save(comment); System.out.println(savedChildComment); // 자식 댓글 저장 + if(board.getUser().getId() != userId) { + noticeService.sendCommentNotification(savedChildComment.getCommentId()); + } return new PostCommentRes(savedChildComment); } diff --git a/src/main/java/com/example/hello_there/login/jwt/Secret.java b/src/main/java/com/example/hello_there/login/jwt/Secret.java new file mode 100644 index 0000000..d9ac8fa --- /dev/null +++ b/src/main/java/com/example/hello_there/login/jwt/Secret.java @@ -0,0 +1,7 @@ +package com.example.hello_there.login.jwt; + +public class Secret { + public static String JWT_SECRET_KEY = "135b8378904571a649516713c9b3bbffc14f3464a3131504aec324cde5327b4d"; + public static String USER_INFO_PASSWORD_KEY = "49e1b884c9469230ae83cd13ff41a03edcfba4288ba75be7ad336c6d8e88d249"; + public static String ROOM_PASSWORD_KEY = "4ff7e6d380cd64c20d7b3c5d60263f5c3a69e2b8457e496e551a93e5f81923df"; +} \ No newline at end of file