From c237c69c56ba904932b203c0741a275435ea8725 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Thu, 18 Apr 2024 17:13:27 +0200 Subject: [PATCH] Added main image to geopoint + localication center to mapDTO --- Manager.Interfaces/DTO/SubSection/MapDTO.cs | 15 +++++++++------ .../Controllers/ConfigurationController.cs | 8 ++++++++ ManagerService/Controllers/ResourceController.cs | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Manager.Interfaces/DTO/SubSection/MapDTO.cs b/Manager.Interfaces/DTO/SubSection/MapDTO.cs index 4892a96..97616d0 100644 --- a/Manager.Interfaces/DTO/SubSection/MapDTO.cs +++ b/Manager.Interfaces/DTO/SubSection/MapDTO.cs @@ -15,29 +15,32 @@ namespace Manager.Interfaces.DTO public string iconResourceId { get; set; } public string iconSource { get; set; } // url to firebase storage or on internet public List categories { get; set; } + public string latitude { get; set; } // Center on + public string longitude { get; set; } // Center on } public class GeoPointDTO { public int? id { get; set; } public List title { get; set; } - public List description { get; set; } + public List description { get; set; } public List contents { get; set; } public CategorieDTO categorie { get; set; } // TO DELETE IN FUTURE public int? categorieId { get; set; } public string latitude { get; set; } public string longitude { get; set; } - - public List schedules { get; set; } - public List prices { get; set; } - public List phone { get; set; } + public string imageResourceId { get; set; } + public string imageUrl { get; set; } + public List schedules { get; set; } + public List prices { get; set; } + public List phone { get; set; } public List email { get; set; } public List site { get; set; } } public class CategorieDTO { - public int? id { get; set; } + public int? id { get; set; } public List label { get; set; } public string icon { get; set; } // icon material public string iconResourceId { get; set; } // icon point geo diff --git a/ManagerService/Controllers/ConfigurationController.cs b/ManagerService/Controllers/ConfigurationController.cs index e3fec4a..9c63ded 100644 --- a/ManagerService/Controllers/ConfigurationController.cs +++ b/ManagerService/Controllers/ConfigurationController.cs @@ -442,6 +442,10 @@ namespace ManagerService.Controllers } foreach (var point in mapDTO.points) { + if (point.imageResourceId != null) + { + addResourceToList(resourceDTOs, point.imageResourceId); + } foreach (var content in point.contents) { if (content.resourceId != null) { @@ -714,6 +718,10 @@ namespace ManagerService.Controllers foreach (var point in mapDTO.points) { + if (point.imageResourceId != null) + { + createResource(exportConfiguration.resources.Where(r => r.id == point.imageResourceId).FirstOrDefault()); + } foreach (var content in point.contents) { if (content.resourceId != null) diff --git a/ManagerService/Controllers/ResourceController.cs b/ManagerService/Controllers/ResourceController.cs index f2794a9..d0f386f 100644 --- a/ManagerService/Controllers/ResourceController.cs +++ b/ManagerService/Controllers/ResourceController.cs @@ -426,6 +426,7 @@ namespace ManagerService.Controllers mapDTO.iconResourceId = mapDTO.iconResourceId == id ? null : mapDTO.iconResourceId; foreach (var point in mapDTO.points) { + point.imageResourceId = point.imageResourceId == id ? null : point.imageResourceId; foreach (var content in point.contents) { content.resourceUrl = content.resourceId == id ? null : content.resourceUrl;