erp-platform/api/src/Kurs.Platform.Domain/Classroom/ClassroomParticipant.cs

68 lines
1.5 KiB
C#
Raw Normal View History

2025-08-25 18:01:57 +00:00
using System;
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-25 18:01:57 +00:00
public DateTime JoinTime { get; set; }
public string ConnectionId { get; set; }
// Navigation properties
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,
bool isTeacher
) : base(id)
{
SessionId = sessionId;
UserId = userId;
UserName = userName;
IsTeacher = isTeacher;
IsAudioMuted = false;
IsVideoMuted = false;
2025-08-29 09:37:38 +00:00
IsHandRaised = false;
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;
}
}