Starting work on Shared Files
This commit is contained in:
97
RelayShared/Rtc/RtcModels.cs
Normal file
97
RelayShared/Rtc/RtcModels.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using SurrealDb.Net.Models;
|
||||
|
||||
namespace RelayShared.Rtc;
|
||||
|
||||
public class RtcSignalTypes
|
||||
{
|
||||
public const string Offer = "rtc_offer";
|
||||
public const string Answer = "rtc_answer";
|
||||
public const string Candidate = "rtc_candidate";
|
||||
public const string OfferUpdated = "rtc_offer_updated";
|
||||
public const string AnswerUpdated = "rtc_answer_updated";
|
||||
}
|
||||
|
||||
public class RtcJoinRequest
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public required string Username { get; set; }
|
||||
}
|
||||
|
||||
public sealed class RtcSessionDescription
|
||||
{
|
||||
public required string Type { get; set; }
|
||||
public required string Sdp { get; set; }
|
||||
}
|
||||
|
||||
public class RtcOffer : Record
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public required string Username { get; set; }
|
||||
public required RtcSessionDescription SessionDescription { get; set; }
|
||||
// public required string Type { get; set; }
|
||||
// public required string Sdp { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
}
|
||||
|
||||
public class RtcLeaveRequest
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public required string Username { get; set; }
|
||||
}
|
||||
|
||||
public class RtcJoinResponse
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public bool HasActiveCall { get; set; }
|
||||
public bool IsOfferer { get; set; }
|
||||
public string? OfferUser { get; set; }
|
||||
public string? OfferSdp { get; set; }
|
||||
}
|
||||
|
||||
public class RtcIceCandidate : Record
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public required string Username { get; set; }
|
||||
public required string Candidate { get; set; }
|
||||
public string? SdpMid { get; set; }
|
||||
public int? SdpMLineIndex { get; set; }
|
||||
// public required string Direction { get; set; } // "offer" or "answer"
|
||||
public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
|
||||
public class DBIceCandidate
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public required string Username { get; set; }
|
||||
public required IceCandidate Candidate { get; set; }
|
||||
}
|
||||
|
||||
public class IceCandidate
|
||||
{
|
||||
public required string candidate { get; set; }
|
||||
public required string sdpMid { get; set; }
|
||||
public required int sdpMLineIndex { get; set; }
|
||||
public required string usernameFragment { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class RtcAnswer : Record
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public required string OfferUser { get; set; }
|
||||
public required string AnswerUser { get; set; }
|
||||
public required string Sdp { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
|
||||
public sealed class RtcActiveCall : Record
|
||||
{
|
||||
public required string ChannelId { get; set; }
|
||||
public string? OfferUser { get; set; }
|
||||
public RtcSessionDescription? Offer { get; set; }
|
||||
public RtcSessionDescription? Answer { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user