// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/common/FromMemberHandler.java
// public abstract class FromMemberHandler implements NextRTCHandler {
// 
//     @Override
//     public final void handleEvent(NextRTCEvent event) {
//         event.from().ifPresent(from -> handleEvent(from, event));
//     }
// 
//     protected abstract void handleEvent(NextRTCMember from, NextRTCEvent event);
// }
// 
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/service/MemberJoinService.java
// @Service
// @Transactional
// public class MemberJoinService {
// 
//     @Autowired
//     private MemberRepository memberRepository;
// 
//     @Autowired
//     private ConversationRepository conversationRepository;
// 
//     public void execute(String memberId, String conversationId) {
//         Conversation conversation = conversationRepository.getByConversationName(conversationId);
//         Member member = memberRepository.getByRtcId(memberId);
// 
//         conversation.join(member);
//     }
// }


import org.nextrtc.examples.videochat_with_rest.domain.handler.common.FromMemberHandler;
import org.nextrtc.examples.videochat_with_rest.service.MemberJoinService;
import org.nextrtc.signalingserver.api.annotation.NextRTCEventListener;
import org.nextrtc.signalingserver.api.dto.NextRTCEvent;
import org.nextrtc.signalingserver.api.dto.NextRTCMember;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static org.nextrtc.signalingserver.api.NextRTCEvents.MEMBER_JOINED;
package org.nextrtc.examples.videochat_with_rest.domain.handler;



@Component
@NextRTCEventListener(MEMBER_JOINED)
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/common/FromMemberHandler.java
// public abstract class FromMemberHandler implements NextRTCHandler {
// 
//     @Override
//     public final void handleEvent(NextRTCEvent event) {
//         event.from().ifPresent(from -> handleEvent(from, event));
//     }
// 
//     protected abstract void handleEvent(NextRTCMember from, NextRTCEvent event);
// }
// 
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/service/MemberJoinService.java
// @Service
// @Transactional
// public class MemberJoinService {
// 
//     @Autowired
//     private MemberRepository memberRepository;
// 
//     @Autowired
//     private ConversationRepository conversationRepository;
// 
//     public void execute(String memberId, String conversationId) {
//         Conversation conversation = conversationRepository.getByConversationName(conversationId);
//         Member member = memberRepository.getByRtcId(memberId);
// 
//         conversation.join(member);
//     }
// }


// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler/MemberJoinedHandler.java
import org.nextrtc.examples.videochat_with_rest.domain.handler.common.FromMemberHandler;
import org.nextrtc.examples.videochat_with_rest.service.MemberJoinService;
import org.nextrtc.signalingserver.api.annotation.NextRTCEventListener;
import org.nextrtc.signalingserver.api.dto.NextRTCEvent;
import org.nextrtc.signalingserver.api.dto.NextRTCMember;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static org.nextrtc.signalingserver.api.NextRTCEvents.MEMBER_JOINED;

package org.nextrtc.examples.videochat_with_rest.domain.handler;



@Component
@NextRTCEventListener(MEMBER_JOINED)
public class MemberJoinedHandler extends FromMemberHandler {