|
|
@@ -33,16 +33,18 @@ namespace BulkPrintingAPI.Controllers
|
|
33
|
33
|
private readonly ILogger _logger;
|
|
34
|
34
|
private readonly IMemoryCache _cache;
|
|
35
|
35
|
private readonly DataEncryptionOptions _dataEncryptionOptions;
|
|
|
36
|
+ private readonly FTPOptions _ftpOptions;
|
|
36
|
37
|
private readonly MAX.ClientFactory _clientFactory;
|
|
37
|
38
|
private readonly MAXContext _context;
|
|
38
|
39
|
|
|
39
|
40
|
public BatchesController(ILoggerFactory loggerFactory, IMemoryCache cache,
|
|
40
|
|
- DataEncryptionOptions dataEncryptionOptions,
|
|
|
41
|
+ DataEncryptionOptions dataEncryptionOptions, FTPOptions ftpOptions,
|
|
41
|
42
|
MAX.ClientFactory clientFactory, MAXContext context)
|
|
42
|
43
|
{
|
|
43
|
44
|
_logger = loggerFactory.CreateLogger(GetType().FullName);
|
|
44
|
45
|
_cache = cache;
|
|
45
|
46
|
_dataEncryptionOptions = dataEncryptionOptions;
|
|
|
47
|
+ _ftpOptions = ftpOptions;
|
|
46
|
48
|
_clientFactory = clientFactory;
|
|
47
|
49
|
_context = context;
|
|
48
|
50
|
}
|
|
|
@@ -82,7 +84,7 @@ namespace BulkPrintingAPI.Controllers
|
|
82
|
84
|
|
|
83
|
85
|
if (!batch.ReadyForDownload)
|
|
84
|
86
|
{
|
|
85
|
|
- await Utils.DownloadVouchersAsync(_context, batch);
|
|
|
87
|
+ await Utils.DownloadVouchersAsync(_ftpOptions, _context, batch);
|
|
86
|
88
|
}
|
|
87
|
89
|
|
|
88
|
90
|
return Ok(batch);
|
|
|
@@ -117,7 +119,7 @@ namespace BulkPrintingAPI.Controllers
|
|
117
|
119
|
|
|
118
|
120
|
try
|
|
119
|
121
|
{
|
|
120
|
|
- await Utils.DownloadVouchersAsync(_context, orderResponse.Batch);
|
|
|
122
|
+ await Utils.DownloadVouchersAsync(_ftpOptions, _context, orderResponse.Batch);
|
|
121
|
123
|
}
|
|
122
|
124
|
catch (Exception e)
|
|
123
|
125
|
{
|