diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs
index a1b8a9d..ed31a9f 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs
@@ -14,10 +14,12 @@ namespace WindowsDataCenter
{
private readonly IRepository _repo;
private readonly ILogger _logger;
+
///
///
///
///
+ ///
public SwipeDataController(IRepository repo, ILogger logger)
{
if(repo == null) throw new ArgumentNullException(nameof(repo));
@@ -36,13 +38,10 @@ namespace WindowsDataCenter
public IHttpActionResult PostData([FromBody] CardData cData)
{
int logId;
- _repo.LogEventTime(new Identifier {UniqueId = cData.CardUId}, out logId);
- _logger.Trace("Received new \"Swipe Event\" for UId: {0} at {1}", cData.CardUId, DateTime.UtcNow);
- return
- ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK)
- {
- Content = new StringContent(logId.ToString())
- });
+ var resp = _repo.LogEventTime(new Identifier {UniqueId = cData.CardUId}, out logId);
+ _logger.Trace("Received new \"Swipe Event\" for UId: {0} at {1}, direction is : {2}", cData.CardUId,
+ DateTime.UtcNow, resp.Direction);
+ return Ok(new {Id = logId, resp.Direction});
}
}
}
\ No newline at end of file