GsDChat/src/GsDChat.Core/Protocol/HttpModels.cs

76 lines
2.5 KiB
C#

using GsDChat.Core.Models;
namespace GsDChat.Core.Protocol;
public class RegisterRequest
{
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string? ServerPassword { get; set; }
public string? InviteToken { get; set; }
public string? PublicKey { get; set; }
public string? EncryptedPrivateKey { get; set; }
}
public class LoginRequest
{
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string? ServerPassword { get; set; }
public string? PublicKey { get; set; }
public string? EncryptedPrivateKey { get; set; }
}
public class AuthResponse
{
public bool Success { get; set; }
public string? Token { get; set; }
public string? UserId { get; set; }
public string? Username { get; set; }
public string? Role { get; set; }
public string? PublicKey { get; set; }
public string? EncryptedPrivateKey { get; set; }
public bool E2eeEnabled { get; set; } = true;
public string? ErrorMessage { get; set; }
}
public class ServerInfoResponse
{
public string ServerName { get; set; } = "GsDChat Server";
public string Version { get; set; } = "1.0.0";
public string RegistrationMode { get; set; } = "Open"; // Open or InviteOnly
public bool RequiresServerPassword { get; set; }
public string Motd { get; set; } = "Welcome to GsDChat!";
public long MaxFileSizeMb { get; set; } = 50;
public bool AllowMemberChannelCreation { get; set; } = true;
public bool AllowDmE2ee { get; set; } = true;
public int MaxGroupChatUsers { get; set; } = 10;
public string? VapidPublicKey { get; set; }
public bool EnableVoiceCalls { get; set; } = true;
public bool AllowVoiceRelayFallback { get; set; } = true;
public int MaxVoiceCallUsers { get; set; } = 10;
public List<IceServerConfig> IceServers { get; set; } = new();
}
public class PushSubscribeRequest
{
public string Endpoint { get; set; } = string.Empty;
public string P256dh { get; set; } = string.Empty;
public string Auth { get; set; } = string.Empty;
public string? UserAgent { get; set; }
}
public class PushUnsubscribeRequest
{
public string Endpoint { get; set; } = string.Empty;
}
public class UploadFileResponse
{
public bool Success { get; set; }
public string? FileId { get; set; }
public string? FileName { get; set; }
public long FileSizeBytes { get; set; }
public string? ChannelId { get; set; }
public string? ErrorMessage { get; set; }
}