mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-29 22:29:24 +02:00
Update Models
This commit is contained in:
parent
0dad0d1a04
commit
c36204dbb9
27 changed files with 509 additions and 5 deletions
14
Application/Models/Requests/ChangeStateRequest.cs
Normal file
14
Application/Models/Requests/ChangeStateRequest.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class ChangeStateRequest
|
||||
{
|
||||
[FromRoute(Name = "id"), Required]
|
||||
public int Id { get; set; }
|
||||
|
||||
[FromBody, Required]
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
22
Application/Models/Requests/CreateClientRequest.cs
Normal file
22
Application/Models/Requests/CreateClientRequest.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class CreateClientRequest
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string? Endpoint { get; set; }
|
||||
public ushort? EndpointPort { get; set; }
|
||||
public string? AllowedAddress { get; set; }
|
||||
public string? PresharedKey { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public string Interface { get; set; }
|
||||
public int? KeepAlive { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string? Expire { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public int? Traffic { get; set; }
|
||||
public bool InheritIP { get; set; }
|
||||
public bool InheritDNS { get; set; }
|
||||
public string? DNSAddress { get; set; }
|
||||
}
|
||||
}
|
15
Application/Models/Requests/CreatePoolRequest.cs
Normal file
15
Application/Models/Requests/CreatePoolRequest.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class CreatePoolRequest
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string? Next { get; set; }
|
||||
public List<string> Ranges { get; set; }
|
||||
}
|
||||
}
|
10
Application/Models/Requests/CreateScriptRequest.cs
Normal file
10
Application/Models/Requests/CreateScriptRequest.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class CreateScriptRequest
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public List<string> Policy { get; set; }
|
||||
public string Source { get; set; }
|
||||
public bool DontRequiredPermissions { get; set; }
|
||||
}
|
||||
}
|
25
Application/Models/Requests/CreateServerRequest.cs
Normal file
25
Application/Models/Requests/CreateServerRequest.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class CreateServerRequest
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public ushort Port { get; set; } = 13231;
|
||||
|
||||
public ushort MTU { get; set; } = 1420;
|
||||
|
||||
public string PrivateKey { get; set; }
|
||||
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
public string IPAddress { get; set; }
|
||||
|
||||
public bool UseIPPool { get; set; }
|
||||
|
||||
public int IPPoolId { get; set; }
|
||||
|
||||
public bool InheritDNS { get; set; }
|
||||
|
||||
public string DNSAddress { get; set; }
|
||||
}
|
||||
}
|
7
Application/Models/Requests/DeleteRequest.cs
Normal file
7
Application/Models/Requests/DeleteRequest.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class DeleteRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
14
Application/Models/Requests/LoginRequest.cs
Normal file
14
Application/Models/Requests/LoginRequest.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class LoginRequest
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
23
Application/Models/Requests/SyncUserRequest.cs
Normal file
23
Application/Models/Requests/SyncUserRequest.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class SyncUserRequest
|
||||
{
|
||||
[FromRoute(Name = "id"), Required]
|
||||
public int ID { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Username is required.")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Password is required.")]
|
||||
public string Password { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "PrivateKey is required.")]
|
||||
public string PrivateKey { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "PublicKey is required.")]
|
||||
public string PublicKey { get; set; }
|
||||
}
|
||||
}
|
27
Application/Models/Requests/UpdateClientRequest.cs
Normal file
27
Application/Models/Requests/UpdateClientRequest.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class UpdateClientRequest
|
||||
{
|
||||
[FromRoute(Name = "id"), Required]
|
||||
public int ID { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? Endpoint { get; set; }
|
||||
public ushort? EndpointPort { get; set; }
|
||||
public string? AllowedAddress { get; set; }
|
||||
public string? PresharedKey { get; set; }
|
||||
public string? PrivateKey { get; set; }
|
||||
public string? PublicKey { get; set; }
|
||||
public string Interface { get; set; }
|
||||
public int? KeepAlive { get; set; }
|
||||
public string? Expire { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public int? Traffic { get; set; }
|
||||
public bool InheritIP { get; set; }
|
||||
public bool InheritDNS { get; set; }
|
||||
public string? DNSAddress { get; set; }
|
||||
}
|
||||
}
|
13
Application/Models/Requests/UpdateDNSRequest.cs
Normal file
13
Application/Models/Requests/UpdateDNSRequest.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class UpdateDNSRequest
|
||||
{
|
||||
public List<string> Servers { get; set; }
|
||||
}
|
||||
}
|
16
Application/Models/Requests/UpdateIPPoolRequest.cs
Normal file
16
Application/Models/Requests/UpdateIPPoolRequest.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class UpdateIPPoolRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string? Next { get; set; }
|
||||
public List<string> Ranges { get; set; }
|
||||
}
|
||||
}
|
13
Application/Models/Requests/UpdateIdentityRequest.cs
Normal file
13
Application/Models/Requests/UpdateIdentityRequest.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class UpdateIdentityRequest
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
25
Application/Models/Requests/UpdateServerRequest.cs
Normal file
25
Application/Models/Requests/UpdateServerRequest.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
namespace MTWireGuard.Application.Models.Requests
|
||||
{
|
||||
public class UpdateServerRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public ushort? Port { get; set; }
|
||||
|
||||
public ushort? MTU { get; set; }
|
||||
|
||||
public string? PrivateKey { get; set; }
|
||||
|
||||
public string? IPAddress { get; set; }
|
||||
|
||||
public bool UseIPPool { get; set; }
|
||||
|
||||
public int? IPPoolId { get; set; }
|
||||
|
||||
public bool InheritDNS { get; set; }
|
||||
|
||||
public string? DNSAddress { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue