From 499065bdb709abc355e44e1b893bf2829e4639a8 Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Thu, 20 Oct 2022 16:37:37 +0200 Subject: [PATCH] Add instanceId to ToSectionDTO and ToResourceDTO + update device controller for instanceId --- Manager.Interfaces/Models/Resource.cs | 3 ++- Manager.Interfaces/Models/Section.cs | 3 ++- ManagerService/Controllers/DeviceController.cs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Manager.Interfaces/Models/Resource.cs b/Manager.Interfaces/Models/Resource.cs index 5a505d8..6e27168 100644 --- a/Manager.Interfaces/Models/Resource.cs +++ b/Manager.Interfaces/Models/Resource.cs @@ -43,7 +43,8 @@ namespace Manager.Interfaces.Models label = Label, type = Type, data = isExport ? Data : null, - dateCreation = DateCreation + dateCreation = DateCreation, + instanceId = InstanceId }; } } diff --git a/Manager.Interfaces/Models/Section.cs b/Manager.Interfaces/Models/Section.cs index c679f72..8f5149c 100644 --- a/Manager.Interfaces/Models/Section.cs +++ b/Manager.Interfaces/Models/Section.cs @@ -81,7 +81,8 @@ namespace Manager.Interfaces.Models isSubSection = IsSubSection, parentId = ParentId, data = Data, - dateCreation = DateCreation + dateCreation = DateCreation, + instanceId = InstanceId, }; } } diff --git a/ManagerService/Controllers/DeviceController.cs b/ManagerService/Controllers/DeviceController.cs index 3ee7bc9..1c004b4 100644 --- a/ManagerService/Controllers/DeviceController.cs +++ b/ManagerService/Controllers/DeviceController.cs @@ -122,6 +122,7 @@ namespace ManagerService.Controllers device.DateCreation = DateTime.Now; } + device.InstanceId = newDevice.instanceId; device.Name = newDevice.name; device.Configuration = configuration.Label; device.ConfigurationId = newDevice.configurationId; @@ -179,6 +180,7 @@ namespace ManagerService.Controllers // Todo add some verification ? device.Name = updatedDevice.name; + device.InstanceId = updatedDevice.instanceId; device.Identifier = updatedDevice.identifier; device.IpAddressWLAN = updatedDevice.ipAddressWLAN; device.IpAddressETH = updatedDevice.ipAddressETH;