Example #1
0
        public async Task <IActionResult> CreateMeeting([FromBody] MeetingWithLearnersDTO _MeetingLeanersDTO)
        {
            try
            {
                var meetingDTO = new MeetingDTO()
                {
                    MeetingLink     = _MeetingLeanersDTO.MeetingLink,
                    StartDateTime   = _MeetingLeanersDTO.StartDateTime,
                    TeacherFullName = _MeetingLeanersDTO.TeacherFullName,
                    Duration        = _MeetingLeanersDTO.Duration,
                    Description     = _MeetingLeanersDTO.Description,
                    CourseName      = _MeetingLeanersDTO.CourseName,
                };
                var meeting = await _meetingService.CreateMeeting(meetingDTO);

                foreach (var _LearnerID in _MeetingLeanersDTO.LearnersID)
                {
                    var learnerMeeting = await _learnerMeetingService.JoinMeeting(_LearnerID, _meetingService.GetMeetingIdByLink(_MeetingLeanersDTO.MeetingLink));
                }
                return(Ok("Meeting Created"));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Example #2
0
        public async Task <IActionResult> JoinMeeting([FromBody] int _MeetingID)
        {
            try
            {
                var UserID         = Guid.Parse(User.GetLoggedInUserId <string>());
                var LeanerID       = _learnerService.GetLearnerIDByUserID(UserID);
                var learnerMeeting = await _learnerMeetingService.JoinMeeting(LeanerID, _MeetingID);

                return(Ok("Meeting Joined"));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }