Update section objects to support multiple PDF at once + MapBox in Map + MapProvider in Agenda

This commit is contained in:
Thomas Fransolet 2024-03-12 22:49:32 +01:00
parent 466c18a6b2
commit fe48dddce2
5 changed files with 35 additions and 5 deletions

View File

@ -7,5 +7,6 @@ namespace Manager.Interfaces.DTO
public class AgendaDTO public class AgendaDTO
{ {
public List<TranslationDTO> resourceIds { get; set; } // All json files for all languages public List<TranslationDTO> resourceIds { get; set; } // All json files for all languages
public MapProvider? mapProvider { get; set; } // Default = Google
} }
} }

View File

@ -8,7 +8,9 @@ namespace Manager.Interfaces.DTO
public class MapDTO public class MapDTO
{ {
public int zoom { get; set; } // Default = 18 public int zoom { get; set; } // Default = 18
public MapTypeApp? mapType { get; set; } // Default = Hybrid public MapTypeApp? mapType { get; set; } // Default = Hybrid for Google
public MapTypeMapBox? mapTypeMapbox { get; set; } // Default = standard for MapBox
public MapProvider? mapProvider { get; set; } // Default = Google
public List<GeoPointDTO> points { get; set; } public List<GeoPointDTO> points { get; set; }
public string iconResourceId { get; set; } public string iconResourceId { get; set; }
public string iconSource { get; set; } // url to firebase storage or on internet public string iconSource { get; set; } // url to firebase storage or on internet
@ -51,4 +53,21 @@ namespace Manager.Interfaces.DTO
terrain, terrain,
hybrid hybrid
} }
public enum MapProvider
{
Google,
MapBox
}
public enum MapTypeMapBox
{
standard,
streets,
outdoors,
light,
dark,
satellite,
satellite_streets
}
} }

View File

@ -6,7 +6,12 @@ namespace Manager.Interfaces.DTO
{ {
public class PdfDTO public class PdfDTO
{ {
public string resourceId { get; set; } // url to resource id public List<PDFFileDTO> pdfs { get; set; }
public string resourceUrl { get; set; } // url to resource firebase or on internet => JSON file }
public class PDFFileDTO
{
public List<TranslationAndResourceDTO> pdfFilesAndTitles { get; set; }
public int? order { get; set; } // Order to show
} }
} }

View File

@ -538,9 +538,12 @@ namespace ManagerService.Controllers
break; break;
case SectionType.PDF: case SectionType.PDF:
PdfDTO pdfDTO = JsonConvert.DeserializeObject<PdfDTO>(section.data); PdfDTO pdfDTO = JsonConvert.DeserializeObject<PdfDTO>(section.data);
if (pdfDTO.resourceId != null) foreach (var pdf in pdfDTO.pdfs)
{ {
addResourceToList(resourceDTOs, pdfDTO.resourceId); foreach (var pdfFileAndTitle in pdf.pdfFilesAndTitles)
{
addResourceToList(resourceDTOs, pdfFileAndTitle.resourceId);
}
} }
break; break;
case SectionType.Agenda: case SectionType.Agenda:

View File

@ -356,6 +356,8 @@ namespace ManagerService.Controllers
case SectionType.Map: case SectionType.Map:
mapDTO = new MapDTO(); mapDTO = new MapDTO();
mapDTO.mapType = MapTypeApp.hybrid; mapDTO.mapType = MapTypeApp.hybrid;
mapDTO.mapTypeMapbox = MapTypeMapBox.standard;
mapDTO.mapProvider = MapProvider.Google;
mapDTO.zoom = 18; mapDTO.zoom = 18;
mapDTO.points = new List<GeoPointDTO>(); mapDTO.points = new List<GeoPointDTO>();