Skip to content

Commit

Permalink
Merge branch 'release/backend' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	backend/src/main/java/com/happy/friendogly/chat/service/ChatCommandService.java
  • Loading branch information
takoyakimchi committed Nov 4, 2024
2 parents 20173f3 + bc5201c commit 6c2a744
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
@RestController
@RequestMapping("/auth")
public class AuthController {

// TODO: KakaoMemberService와 AuthService 통합
private final KakaoMemberService kakaoMemberService;
private final AuthService authService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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));
}
}

0 comments on commit 6c2a744

Please sign in to comment.