Adding functionality to queueing contact creation
This commit is contained in:
@@ -9,15 +9,17 @@ namespace TextSender_API.Controllers;
|
||||
public class ContactQueueCreationController : ControllerBase
|
||||
{
|
||||
#region Fields
|
||||
private IConfiguration _config;
|
||||
private readonly ILogger<ContactQueueCreationController> _logger;
|
||||
#endregion
|
||||
|
||||
|
||||
#region Constructors
|
||||
|
||||
public ContactQueueCreationController(ILogger<ContactQueueCreationController> logger)
|
||||
public ContactQueueCreationController(ILogger<ContactQueueCreationController> logger, IConfiguration config)
|
||||
{
|
||||
this._logger = logger;
|
||||
this._config = config;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -28,6 +30,20 @@ public class ContactQueueCreationController : ControllerBase
|
||||
{
|
||||
// TODO: Save the file on the filesystem to be processed by a separate
|
||||
// system
|
||||
|
||||
try
|
||||
{
|
||||
var ctMgr = new ContactManagement(this._config);
|
||||
|
||||
foreach (var file in contactFile)
|
||||
{
|
||||
ctMgr.QueueContact(file);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user