From 1db418e708ffdcfb4f78f5f82116af33981fb424 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Wed, 10 Apr 2024 09:20:51 +0200 Subject: [PATCH] Added WeatherDTO + fix export issue + config layout values (rounded, isPictureBackground and ScreenPercentage) + values for mapDTO --- Manager.Interfaces/Models/Section.cs | 3 ++- ManagerService/Controllers/SectionController.cs | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Manager.Interfaces/Models/Section.cs b/Manager.Interfaces/Models/Section.cs index 3cf768f..5f73c39 100644 --- a/Manager.Interfaces/Models/Section.cs +++ b/Manager.Interfaces/Models/Section.cs @@ -118,6 +118,7 @@ namespace Manager.Interfaces.Models Article, PDF, Puzzle, - Agenda + Agenda, + Weather } } diff --git a/ManagerService/Controllers/SectionController.cs b/ManagerService/Controllers/SectionController.cs index 959c06c..4ab7baa 100644 --- a/ManagerService/Controllers/SectionController.cs +++ b/ManagerService/Controllers/SectionController.cs @@ -435,6 +435,10 @@ namespace ManagerService.Controllers AgendaDTO agendaDTO = new AgendaDTO(); section.Data = JsonConvert.SerializeObject(agendaDTO); // Include all info from specific section as JSON break; + case SectionType.Weather: + WeatherDTO weatherDTO = new WeatherDTO(); + section.Data = JsonConvert.SerializeObject(weatherDTO); // Include all info from specific section as JSON + break; } Section sectionCreated = _sectionService.Create(section); @@ -764,5 +768,15 @@ namespace ManagerService.Controllers { return new ObjectResult("AgendaDTO") { StatusCode = 200 }; } + + /// + /// Useless, just to generate dto code + /// + [ProducesResponseType(typeof(WeatherDTO), 200)] + [HttpGet("WeatherDTO")] + public ObjectResult GetWeatherDTO() + { + return new ObjectResult("WeatherDTO") { StatusCode = 200 }; + } } }