Add printer-config integration and Rust transformation flow docs
This commit is contained in:
@@ -12,18 +12,23 @@ namespace PrintService.Services;
|
||||
public class DocumentProcessor
|
||||
{
|
||||
private readonly AppSettings _settings;
|
||||
private readonly ConfigurationService _configService;
|
||||
private readonly ILogger<DocumentProcessor> _logger;
|
||||
|
||||
public DocumentProcessor(IOptions<AppSettings> settings, ILogger<DocumentProcessor> logger)
|
||||
public DocumentProcessor(
|
||||
IOptions<AppSettings> settings,
|
||||
ConfigurationService configService,
|
||||
ILogger<DocumentProcessor> logger)
|
||||
{
|
||||
_settings = settings.Value;
|
||||
_configService = configService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process and transform document content
|
||||
/// </summary>
|
||||
public string ProcessDocument(string content, DocumentConfig config)
|
||||
public string ProcessDocument(string content, DocumentTypeConfig config)
|
||||
{
|
||||
var processed = content;
|
||||
|
||||
@@ -48,12 +53,11 @@ public class DocumentProcessor
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get document configuration by type
|
||||
/// Get document configuration by type from printer-config.json
|
||||
/// </summary>
|
||||
public DocumentConfig? GetDocumentConfig(string documentType)
|
||||
public DocumentTypeConfig? GetDocumentConfig(string documentType)
|
||||
{
|
||||
return _settings.DocumentTypes.FirstOrDefault(dt =>
|
||||
dt.Name.Equals(documentType, StringComparison.OrdinalIgnoreCase));
|
||||
return _configService.GetDocumentType(documentType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -67,7 +71,7 @@ public class DocumentProcessor
|
||||
/// <summary>
|
||||
/// Archive or delete file after processing
|
||||
/// </summary>
|
||||
public void PostProcess(PrintJob job, DocumentConfig config)
|
||||
public void PostProcess(PrintJob job, DocumentTypeConfig config)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user