diff --git a/backend/src/main/java/com/happy/friendogly/auth/controller/AuthController.java b/backend/src/main/java/com/happy/friendogly/auth/controller/AuthController.java index a2dcdff64..398a46a3d 100644 --- a/backend/src/main/java/com/happy/friendogly/auth/controller/AuthController.java +++ b/backend/src/main/java/com/happy/friendogly/auth/controller/AuthController.java @@ -18,7 +18,6 @@ @RestController @RequestMapping("/auth") public class AuthController { - // TODO: KakaoMemberService와 AuthService 통합 private final KakaoMemberService kakaoMemberService; private final AuthService authService; diff --git a/backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java b/backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java index 67290f50e..43e52c6e2 100644 --- a/backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java +++ b/backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java @@ -29,26 +29,26 @@ public class ChatCommandService { private static final String EMPTY_CONTENT = ""; private final MemberRepository memberRepository; + private final ClubRepository clubRepository; private final ChatRoomRepository chatRoomRepository; private final ChatMessageRepository chatMessageRepository; - private final ClubRepository clubRepository; private final NotificationService notificationService; - private final ChatTemplate chatTemplate; + private final ChatTemplate template; public ChatCommandService( MemberRepository memberRepository, + ClubRepository clubRepository, ChatRoomRepository chatRoomRepository, ChatMessageRepository chatMessageRepository, - ClubRepository clubRepository, NotificationService notificationService, - ChatTemplate chatTemplate + ChatTemplate template ) { this.memberRepository = memberRepository; + this.clubRepository = clubRepository; this.chatRoomRepository = chatRoomRepository; this.chatMessageRepository = chatMessageRepository; - this.clubRepository = clubRepository; this.notificationService = notificationService; - this.chatTemplate = chatTemplate; + this.template = template; } public void sendEnter(Long senderMemberId, Long chatRoomId) { @@ -78,8 +78,9 @@ private void sendAndSave(MessageType messageType, String content, ChatRoom chatR ChatMessageSocketResponse chat = new ChatMessageSocketResponse( messageType, content, senderMember, LocalDateTime.now()); Club club = clubRepository.getByChatRoomId(chatRoom.getId()); + notificationService.sendChatNotification(chatRoom.getId(), chat, club); - chatTemplate.convertAndSend(chatRoom.getId(), chat); + template.convertAndSend(chatRoom.getId(), chat); chatMessageRepository.save(new ChatMessage(chatRoom, messageType, senderMember, content)); } }