2023-06-02 15:26:29 +03:30
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace MTWireGuard.Application.Models.Mikrotik
|
|
|
|
|
{
|
|
|
|
|
[PrimaryKey("Id")]
|
|
|
|
|
[Index("PrivateKey", IsUnique = true)]
|
|
|
|
|
[Index("PublicKey", IsUnique = true)]
|
|
|
|
|
public class WGPeerDBModel
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string? Name { get; set; }
|
|
|
|
|
public string PrivateKey { get; set; }
|
|
|
|
|
public string PublicKey { get; set; }
|
2023-06-23 17:00:49 +03:30
|
|
|
|
public DateTime? Expire { get; set; }
|
|
|
|
|
public int? ExpireID { get; set; }
|
2024-01-25 20:36:44 +03:30
|
|
|
|
public int RX { get; set; }
|
|
|
|
|
public int TX { get; set; }
|
|
|
|
|
public int TrafficLimit { get; set; }
|
|
|
|
|
public string? DNSAddress { get; set; }
|
|
|
|
|
public bool InheritDNS { get; set; }
|
|
|
|
|
public bool InheritIP { get; set; }
|
2023-06-02 15:26:29 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class WGPeerViewModel
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string Address { get; set; }
|
|
|
|
|
public string CurrentAddress { get; set; }
|
|
|
|
|
public bool IsEnabled { get; set; }
|
|
|
|
|
public string Interface { get; set; }
|
|
|
|
|
public string PrivateKey { get; set; }
|
|
|
|
|
public string PublicKey { get; set; }
|
|
|
|
|
public string Download { get; set; }
|
|
|
|
|
public string Upload { get; set; }
|
|
|
|
|
public long DownloadBytes { get; set; }
|
|
|
|
|
public long UploadBytes { get; set; }
|
|
|
|
|
public bool IsDifferent { get; set; }
|
2023-06-23 17:00:49 +03:30
|
|
|
|
public string Expire { get; set; }
|
2024-01-25 20:36:44 +03:30
|
|
|
|
public int Traffic { get; set; }
|
|
|
|
|
public uint TrafficUsed { get; set; }
|
|
|
|
|
public string LastHandshake { get; set; }
|
|
|
|
|
public string DNSAddress { get; set; }
|
|
|
|
|
public bool InheritDNS { get; set; }
|
|
|
|
|
public bool InheritIP { get; set; }
|
2023-06-02 15:26:29 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class UserCreateModel
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string PrivateKey { get; set; }
|
|
|
|
|
public string AllowedAddress { get; set; }
|
|
|
|
|
public bool Disabled { get; set; }
|
|
|
|
|
public string Interface { get; set; }
|
|
|
|
|
public string EndpointAddress { get; set; }
|
|
|
|
|
public string EndpointPort { get; set; }
|
|
|
|
|
public string PublicKey { get; set; }
|
|
|
|
|
public string PresharedKey { get; set; }
|
|
|
|
|
public string PersistentKeepalive { get; set; }
|
2024-01-25 20:36:44 +03:30
|
|
|
|
public DateTime? Expire { get; set; } = null;
|
|
|
|
|
public int Traffic { get; set; }
|
|
|
|
|
public string DNSAddress { get; set; }
|
|
|
|
|
public bool InheritDNS { get; set; }
|
|
|
|
|
public bool InheritIP { get; set; }
|
2023-06-02 15:26:29 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class UserSyncModel
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string PrivateKey { get; set; }
|
|
|
|
|
public string PublicKey { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class UserUpdateModel
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string AllowedAddress { get; set; }
|
|
|
|
|
public string Interface { get; set; }
|
|
|
|
|
public string EndpointAddress { get; set; }
|
|
|
|
|
public ushort EndpointPort { get; set; }
|
|
|
|
|
public string PublicKey { get; set; }
|
|
|
|
|
public string PrivateKey { get; set; }
|
|
|
|
|
public string PresharedKey { get; set; }
|
|
|
|
|
public int PersistentKeepalive { get; set; }
|
2023-06-23 17:00:49 +03:30
|
|
|
|
public DateTime Expire { get; set; }
|
2024-01-25 20:36:44 +03:30
|
|
|
|
public int Traffic { get; set; }
|
|
|
|
|
public string DNSAddress { get; set; }
|
|
|
|
|
public bool InheritDNS { get; set; }
|
|
|
|
|
public bool InheritIP { get; set; }
|
2023-06-02 15:26:29 +03:30
|
|
|
|
}
|
|
|
|
|
}
|