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

69 lines
1.4 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-26 05:59:39 +00:00
public class ClassParticipant : 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 string UserEmail { get; set; }
public bool IsTeacher { get; set; }
public bool IsAudioMuted { get; set; }
public bool IsVideoMuted { get; set; }
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-26 05:59:39 +00:00
protected ClassParticipant()
2025-08-25 18:01:57 +00:00
{
}
2025-08-26 05:59:39 +00:00
public ClassParticipant(
2025-08-25 18:01:57 +00:00
Guid id,
Guid sessionId,
Guid? userId,
string userName,
string userEmail,
bool isTeacher
) : base(id)
{
SessionId = sessionId;
UserId = userId;
UserName = userName;
UserEmail = userEmail;
IsTeacher = isTeacher;
IsAudioMuted = false;
IsVideoMuted = false;
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;
}
}