2025-08-25 18:01:57 +00:00
|
|
|
using System;
|
2025-08-31 20:26:49 +00:00
|
|
|
using System.Text.Json.Serialization;
|
2025-08-25 18:01:57 +00:00
|
|
|
using Volo.Abp.Domain.Entities.Auditing;
|
|
|
|
|
|
|
|
|
|
namespace Kurs.Platform.Entities;
|
|
|
|
|
|
2025-08-29 09:37:38 +00:00
|
|
|
public class ClassroomParticipant : FullAuditedEntity<Guid>
|
2025-08-25 18:01:57 +00:00
|
|
|
{
|
|
|
|
|
public Guid SessionId { get; set; }
|
|
|
|
|
public Guid? UserId { get; set; }
|
|
|
|
|
public string UserName { get; set; }
|
|
|
|
|
public bool IsTeacher { get; set; }
|
2025-08-29 09:37:38 +00:00
|
|
|
public bool IsAudioMuted { get; set; } = false;
|
|
|
|
|
public bool IsVideoMuted { get; set; } = false;
|
|
|
|
|
public bool IsHandRaised { get; set; } = false;
|
2025-08-31 15:19:28 +00:00
|
|
|
public bool IsKicked { get; set; } = false;
|
2025-08-30 12:05:50 +00:00
|
|
|
public bool IsActive { get; set; } = true;
|
2025-08-25 18:01:57 +00:00
|
|
|
public DateTime JoinTime { get; set; }
|
|
|
|
|
public string ConnectionId { get; set; }
|
|
|
|
|
|
2025-08-31 20:26:49 +00:00
|
|
|
[JsonIgnore]
|
2025-08-26 05:59:39 +00:00
|
|
|
public virtual Classroom Session { get; set; }
|
2025-08-25 18:01:57 +00:00
|
|
|
|
2025-08-29 09:37:38 +00:00
|
|
|
protected ClassroomParticipant()
|
2025-08-25 18:01:57 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-29 09:37:38 +00:00
|
|
|
public ClassroomParticipant(
|
2025-08-25 18:01:57 +00:00
|
|
|
Guid id,
|
|
|
|
|
Guid sessionId,
|
|
|
|
|
Guid? userId,
|
|
|
|
|
string userName,
|
2025-08-30 10:21:22 +00:00
|
|
|
bool isTeacher,
|
|
|
|
|
bool isAudioMuted,
|
|
|
|
|
bool isVideoMuted,
|
2025-08-30 12:05:50 +00:00
|
|
|
bool isHandRaised,
|
2025-08-31 15:19:28 +00:00
|
|
|
bool isKicked,
|
2025-08-30 12:05:50 +00:00
|
|
|
bool isActive
|
2025-08-25 18:01:57 +00:00
|
|
|
) : base(id)
|
|
|
|
|
{
|
|
|
|
|
SessionId = sessionId;
|
|
|
|
|
UserId = userId;
|
|
|
|
|
UserName = userName;
|
|
|
|
|
IsTeacher = isTeacher;
|
2025-08-30 10:21:22 +00:00
|
|
|
IsAudioMuted = isAudioMuted;
|
|
|
|
|
IsVideoMuted = isVideoMuted;
|
|
|
|
|
IsHandRaised = isHandRaised;
|
2025-08-30 12:05:50 +00:00
|
|
|
IsActive = isActive;
|
2025-08-31 15:19:28 +00:00
|
|
|
IsKicked = isKicked;
|
2025-08-25 18:01:57 +00:00
|
|
|
JoinTime = DateTime.UtcNow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void MuteAudio()
|
|
|
|
|
{
|
|
|
|
|
IsAudioMuted = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UnmuteAudio()
|
|
|
|
|
{
|
|
|
|
|
IsAudioMuted = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void MuteVideo()
|
|
|
|
|
{
|
|
|
|
|
IsVideoMuted = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UnmuteVideo()
|
|
|
|
|
{
|
|
|
|
|
IsVideoMuted = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateConnectionId(string connectionId)
|
|
|
|
|
{
|
|
|
|
|
ConnectionId = connectionId;
|
|
|
|
|
}
|
|
|
|
|
}
|