2024-10-20 16:39:13 -04:00
|
|
|
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)
|
|
|
|
{
|
2024-10-21 16:44:20 -04:00
|
|
|
return new RequestResult(true, result, notifyClientsOnAccount);
|
2024-10-20 16:39:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public static RequestResult Failed(string error, bool notifyClientsOnAccount = true)
|
|
|
|
{
|
2024-10-21 16:44:20 -04:00
|
|
|
return new RequestResult(false, error, notifyClientsOnAccount);
|
2024-10-20 16:39:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|