Moved Requests classes to here. Added some checks to requests.

This commit is contained in:
Tom
2024-10-20 20:39:13 +00:00
parent a9cdb65895
commit e3c78d96fa
23 changed files with 186 additions and 150 deletions

View File

@@ -1,5 +1,4 @@
using HermesSocketLibrary.db;
using HermesSocketLibrary.Requests;
using ILogger = Serilog.ILogger;
namespace HermesSocketServer.Requests
@@ -7,6 +6,7 @@ namespace HermesSocketServer.Requests
public class GetChatterIds : IRequest
{
public string Name => "get_chatter_ids";
public string[] RequiredKeys => [];
private Database _database;
private ILogger _logger;
@@ -22,7 +22,7 @@ namespace HermesSocketServer.Requests
string sql = $"SELECT id FROM \"Chatter\"";
await _database.Execute(sql, (IDictionary<string, object>?) null, (r) => ids.Add(r.GetInt64(0)));
_logger.Information($"Fetched all chatters for channel [channel: {sender}]");
return new RequestResult(true, ids, notifyClientsOnAccount: false);
return RequestResult.Successful(ids, notifyClientsOnAccount: false);
}
}
}