2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 16:33:43 -04:00

JournalService setup work in progress

This commit is contained in:
2024-05-07 12:02:43 +01:00
parent d59914e277
commit f3ce62b551
12 changed files with 215 additions and 85 deletions

View File

@ -5,16 +5,41 @@ using Observatory.Framework.Files.Journal.Odyssey;
public interface IShipLockerService : IJournalHandler<ShipLockerMaterials>;
public class ShipLockerService(ILogger<ShipLockerService> logger)
: JournalHandlerBase<ShipLockerMaterials>(logger), IShipLockerService
: IShipLockerService
{
public override string FileName => FileHandlerService.ShipLockerFileName;
public string FileName => FileHandlerService.ShipLockerFileName;
public override Task<ShipLockerMaterials> Get()
public bool ValidateFile(string filePath)
{
if (!File.Exists(filePath))
{
logger.LogWarning("Journal file {JournalFile} does not exist", filePath);
return false;
}
var fileInfo = new FileInfo(filePath);
if (!string.Equals(fileInfo.Name, FileName, StringComparison.InvariantCultureIgnoreCase))
{
logger.LogWarning("Journal file {name} is not valid");
return false;
}
if (fileInfo.Length == 0)
{
logger.LogWarning("Journal file {name} is empty", filePath);
return false;
}
return true;
}
public Task<ShipLockerMaterials> Get()
{
throw new NotImplementedException();
}
public override Task HandleFile(string filePath)
public Task HandleFile(string filePath)
{
throw new NotImplementedException();
}