Added database entities, started with node crud

This commit is contained in:
Masu-Baumgartner
2024-08-30 15:25:34 +02:00
parent c4a4fbd221
commit fba40d6689
25 changed files with 1887 additions and 5 deletions

View File

@@ -0,0 +1,8 @@
namespace MoonlightServers.Shared.Enums;
public enum BackupState
{
Creating = 0,
Failed = 1,
Created = 2
}

View File

@@ -0,0 +1,9 @@
namespace MoonlightServers.Shared.Enums;
public enum StarVariableType
{
Text = 0,
Number = 1,
Toggle = 2,
Select = 3
}

View File

@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace MoonlightServers.Shared.Http.Requests.Admin.Nodes;
public class CreateNodeRequest
{
[Required(ErrorMessage = "You need to provide a name")]
public string Name { get; set; }
[Required(ErrorMessage = "You need to provide a fqdn")]
public string Fqdn { get; set; }
[Range(1, 65535, ErrorMessage = "You need to provide a valid port")]
public int ApiPort { get; set; } = 8080;
public bool SslEnabled { get; set; } = false;
}

View File

@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace MoonlightServers.Shared.Http.Requests.Admin.Nodes;
public class UpdateNodeRequest
{
[Required(ErrorMessage = "You need to provide a name")]
public string Name { get; set; }
[Required(ErrorMessage = "You need to provide a fqdn")]
public string Fqdn { get; set; }
[Range(1, 65535, ErrorMessage = "You need to provide a valid port")]
public int ApiPort { get; set; } = 8080;
public bool SslEnabled { get; set; } = false;
}

View File

@@ -0,0 +1,11 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.Nodes;
public class DetailNodeResponse
{
public int Id { get; set; }
public string Name { get; set; }
public string Fqdn { get; set; }
public int ApiPort { get; set; }
public bool SslEnabled { get; set; }
}

View File

@@ -7,8 +7,6 @@
</PropertyGroup>
<ItemGroup>
<Folder Include="Http\Requests\" />
<Folder Include="Http\Responses\" />
<Folder Include="Models\" />
</ItemGroup>