Added model and started working on endpoint
Working on endpoint to create contacts using a file
This commit is contained in:
@@ -26,6 +26,8 @@ public class ContactQueueCreationController : ControllerBase
|
|||||||
public IActionResult Upload([FromForm(Name = "file")] List<IFormFile> contactFile,
|
public IActionResult Upload([FromForm(Name = "file")] List<IFormFile> contactFile,
|
||||||
[FromForm(Name = "user_id")] string userID)
|
[FromForm(Name = "user_id")] string userID)
|
||||||
{
|
{
|
||||||
|
// TODO: Save the file on the filesystem to be processed by a separate
|
||||||
|
// system
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
using MongoDB.Bson;
|
||||||
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
|
|
||||||
namespace TextSender_API.Models;
|
namespace TextSender_API.Models;
|
||||||
|
|
||||||
public class Contact
|
public class Contact
|
||||||
@@ -13,3 +16,23 @@ public class Contact
|
|||||||
public int UserID { get; set; }
|
public int UserID { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ContactCreationQueue
|
||||||
|
{
|
||||||
|
#region Properties
|
||||||
|
[BsonId]
|
||||||
|
[BsonRepresentation(BsonType.ObjectId)]
|
||||||
|
public string? Id { get; set; }
|
||||||
|
[BsonElement("filepath")]
|
||||||
|
public string? Filepath { get; set; }
|
||||||
|
[BsonElement("status")]
|
||||||
|
public string? Status { get; set; }
|
||||||
|
[BsonElement("user_id")]
|
||||||
|
public string? UserId { get; set; }
|
||||||
|
[BsonElement("date_created")]
|
||||||
|
public DateTime? DateCreated { get; set; }
|
||||||
|
[BsonElement("processed")]
|
||||||
|
public bool? Processed { get; set; }
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user