From 760f37b14be6df8d36082f077f51abf3b6f0f5d3 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Thu, 9 Feb 2017 21:36:22 +0000 Subject: [PATCH] added manuallog object to allow users to create a sign in/out log for the swipedatacontroller log. --- .../Interfaces/Interfaces.csproj | 1 + .../WindowsDataCenter/Interfaces/ManualLog.cs | 14 ++++++++++ .../Controllers/SwipeDataController.cs | 26 +++++++++++++++---- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 DataCenter_Windows/WindowsDataCenter/Interfaces/ManualLog.cs diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj b/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj index fc07581..a830d09 100644 --- a/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj @@ -44,6 +44,7 @@ + diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/ManualLog.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/ManualLog.cs new file mode 100644 index 0000000..9ebaab3 --- /dev/null +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/ManualLog.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Interfaces +{ + public class ManualLog + { + public int UserId { get; set; } + public DateTime LogDateTime { get; set; } + } +} diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs index b2230de..19a9d6f 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs @@ -6,16 +6,28 @@ using Interfaces; namespace WindowsDataCenter { + /// + /// + /// [RoutePrefix("api/swipedata")] public class SwipeDataController : ApiController { private readonly IRepository _repo; + /// + /// + /// + /// public SwipeDataController(IRepository repo) { if(repo == null) throw new ArgumentNullException(); _repo = repo; } + /// + /// + /// + /// + /// [HttpPost] [Route("")] public IHttpActionResult PostData([FromBody] CardData cData) @@ -28,10 +40,14 @@ namespace WindowsDataCenter Content = new StringContent(logId.ToString()) }); } - - //need another method here for posting. - //public IHttpActionResult ManuallyPostData([FromBody] ManualLog log){ - // - //} + /// + /// + /// + /// + /// + public IHttpActionResult ManuallyPostData([FromBody] ManualLog log) + { + throw new NotImplementedException(); + } } } \ No newline at end of file