Added model and started working on endpoint

Working on endpoint to create contacts using a file
This commit is contained in:
kdeng00
2023-10-02 06:49:02 -04:00
parent 13cb3949fc
commit 794368883d
2 changed files with 25 additions and 0 deletions
@@ -26,6 +26,8 @@ public class ContactQueueCreationController : ControllerBase
public IActionResult Upload([FromForm(Name = "file")] List<IFormFile> contactFile,
[FromForm(Name = "user_id")] string userID)
{
// TODO: Save the file on the filesystem to be processed by a separate
// system
return Ok();
}
#endregion
+23
View File
@@ -1,5 +1,8 @@
using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace TextSender_API.Models;
public class Contact
@@ -13,3 +16,23 @@ public class Contact
public int UserID { get; set; }
#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
}