Implemented basic ui for server sharing. Extracted server authorization. Refactoring and small improvements
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using MoonlightServers.ApiServer.Database.Entities;
|
||||
|
||||
namespace MoonlightServers.ApiServer.Models;
|
||||
|
||||
public record ServerAuthorizationResult
|
||||
{
|
||||
public bool Succeeded { get; set; }
|
||||
public ServerShare? Share { get; set; }
|
||||
public string? Message { get; set; }
|
||||
|
||||
public static ServerAuthorizationResult Success(ServerShare? share = null)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Succeeded = true,
|
||||
Share = share
|
||||
};
|
||||
}
|
||||
|
||||
public static ServerAuthorizationResult Failed(string? message = null)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Succeeded = false,
|
||||
Message = message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using MoonlightServers.Shared.Models;
|
||||
|
||||
namespace MoonlightServers.ApiServer.Models;
|
||||
|
||||
public class ServerShareContent
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using MoonlightServers.Shared.Enums;
|
||||
|
||||
namespace MoonlightServers.ApiServer.Models;
|
||||
|
||||
public class ServerSharePermission
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public ServerPermissionType Type { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user