diff --git a/Manager.Interfaces/DTO/DeviceDTO.cs b/Manager.Interfaces/DTO/DeviceDTO.cs
new file mode 100644
index 0000000..51a091b
--- /dev/null
+++ b/Manager.Interfaces/DTO/DeviceDTO.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Manager.Interfaces.DTO
+{
+ public class DeviceDTO
+ {
+ public string Id { get; set; }
+ public string Name { get; set; }
+ public string IpAddress { get; set; }
+ public bool Connected{ get; set; }
+ public DateTime DateCreation{ get; set; }
+ }
+}
diff --git a/Manager.Interfaces/Models/Device.cs b/Manager.Interfaces/Models/Device.cs
new file mode 100644
index 0000000..921111b
--- /dev/null
+++ b/Manager.Interfaces/Models/Device.cs
@@ -0,0 +1,63 @@
+using Manager.Interfaces.DTO;
+using MongoDB.Bson.Serialization.Attributes;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Manager.Interfaces.Models
+{
+ ///
+ /// Device Information (Tablet)
+ ///
+ public class Device
+ {
+ [BsonId]
+ [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
+ public string Id { get; set; }
+
+ [BsonElement("Name")]
+ public string Name { get; set; }
+
+ [BsonElement("IpAddress")]
+ [BsonRequired]
+ public string IpAddress { get; set; }
+
+ [BsonElement("ConfigurationId")]
+ [BsonRequired]
+ public string ConfigurationId { get; set; }
+
+ [BsonElement("Connected")]
+ [BsonRequired]
+ public bool Connected { get; set; }
+
+ [BsonElement("DateCreation")]
+ public DateTime DateCreation { get; set; }
+
+ // BatteryLevel in case of powered devices
+ [BsonElement("BatteryLevel")]
+ public string BatteryLevel { get; set; }
+
+ [BsonElement("LastBatteryLevel")]
+ public DateTime LastBatteryLevel { get; set; }
+
+ // ConnectionLevel wifi strength level
+ [BsonElement("ConnectionLevel")]
+ public string ConnectionLevel { get; set; }
+
+ [BsonElement("LastConnectionLevel")]
+ public DateTime LastConnectionLevel { get; set; }
+
+
+ public DeviceDTO ToDTO()
+ {
+ return new DeviceDTO()
+ {
+ Id = Id,
+ Name = Name,
+ IpAddress = IpAddress,
+ Connected = Connected,
+ DateCreation = DateCreation
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/ManagerService/Controllers/SectionController.cs b/ManagerService/Controllers/SectionController.cs
index 1cc8891..f7be695 100644
--- a/ManagerService/Controllers/SectionController.cs
+++ b/ManagerService/Controllers/SectionController.cs
@@ -48,21 +48,58 @@ namespace ManagerService.Controllers
}
}
+ ///
+ /// Get a list of all section from a specific configuration
+ ///
+ /// configuration id
+ [ProducesResponseType(typeof(List), 200)]
+ [ProducesResponseType(typeof(string), 500)]
+ [ProducesResponseType(typeof(string), 400)]
+ [HttpGet("configuration/{id}")]
+ public ObjectResult GetFromConfiguration(string id)
+ {
+ try
+ {
+ if (id == null)
+ throw new ArgumentNullException("Param is null");
+
+ List sections = _sectionService.GetAllFromConfiguration(id);
+
+ return new OkObjectResult(sections.Select(r => r.ToDTO()));
+ }
+ catch (ArgumentNullException ex)
+ {
+ return new BadRequestObjectResult(ex.Message) { };
+ }
+ catch (Exception ex)
+ {
+ return new ObjectResult(ex.Message) { StatusCode = 500 };
+ }
+ }
+
///
/// Get a list of all subsection (summary) of a specific section
///
/// section id
[ProducesResponseType(typeof(List