Moved Requests classes to here. Added some checks to requests.
This commit is contained in:
26
Requests/RequestResult.cs
Normal file
26
Requests/RequestResult.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace HermesSocketServer.Requests
|
||||
{
|
||||
public class RequestResult
|
||||
{
|
||||
public bool Success;
|
||||
public object? Result;
|
||||
public bool NotifyClientsOnAccount;
|
||||
|
||||
private RequestResult(bool success, object? result, bool notifyClientsOnAccount = true)
|
||||
{
|
||||
Success = success;
|
||||
Result = result;
|
||||
NotifyClientsOnAccount = notifyClientsOnAccount;
|
||||
}
|
||||
|
||||
public static RequestResult Successful(object? result, bool notifyClientsOnAccount = true)
|
||||
{
|
||||
return RequestResult.Successful(result, notifyClientsOnAccount);
|
||||
}
|
||||
|
||||
public static RequestResult Failed(string error, bool notifyClientsOnAccount = true)
|
||||
{
|
||||
return RequestResult.Successful(error, notifyClientsOnAccount);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user