Added weather fields + Added JSONUrl resourceType

This commit is contained in:
Thomas Fransolet 2024-01-23 17:49:31 +01:00
parent 4d85ad7c86
commit b193763e73
4 changed files with 28 additions and 3 deletions

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Xml.Linq;
namespace Manager.Interfaces.DTO namespace Manager.Interfaces.DTO
{ {
@ -24,9 +25,17 @@ namespace Manager.Interfaces.DTO
public List<string> sectionIds { get; set; } public List<string> sectionIds { get; set; }
public string loaderImageId { get; set; } // == ResourceId public string loaderImageId { get; set; } // == ResourceId
public string loaderImageUrl { get; set; } // == Image url public string loaderImageUrl { get; set; } // == Image url
public string weatherCity { get; set; } // weatherCity public string weatherCity { get; set; } // Weather City
public DateTimeOffset? weatherUpdatedDate { get; set; } // Weather date update (to only refresh)
public string weatherResult { get; set; } // Weather result
public bool isWeather
{
get
{
return weatherCity != null && weatherCity.Trim().Length > 0;
}
}
public bool isDate { get; set; } public bool isDate { get; set; }
public bool isHour { get; set; } public bool isHour { get; set; }
} }

View File

@ -64,6 +64,12 @@ namespace Manager.Interfaces.Models
[BsonElement("WeatherCity")] [BsonElement("WeatherCity")]
public string WeatherCity { get; set; } public string WeatherCity { get; set; }
[BsonElement("WeatherUpdatedDate")]
public DateTimeOffset? WeatherUpdatedDate { get; set; }
[BsonElement("WeatherResult")]
public string WeatherResult { get; set; }
[BsonElement("IsDate")] [BsonElement("IsDate")]
public bool IsDate { get; set; } public bool IsDate { get; set; }
@ -82,6 +88,8 @@ namespace Manager.Interfaces.Models
loaderImageId = LoaderImageId, loaderImageId = LoaderImageId,
loaderImageUrl = LoaderImageUrl, loaderImageUrl = LoaderImageUrl,
weatherCity = WeatherCity, weatherCity = WeatherCity,
weatherUpdatedDate = WeatherUpdatedDate,
weatherResult = WeatherResult,
dateCreation = DateCreation, dateCreation = DateCreation,
primaryColor = PrimaryColor, primaryColor = PrimaryColor,
languages = Languages, languages = Languages,

View File

@ -56,6 +56,7 @@ namespace Manager.Interfaces.Models
VideoUrl, VideoUrl,
Audio, Audio,
PDF, PDF,
JSON JSON,
JSONUrl
} }
} }

View File

@ -167,6 +167,8 @@ namespace ManagerService.Controllers
configuration.LoaderImageId = newConfiguration.loaderImageId; configuration.LoaderImageId = newConfiguration.loaderImageId;
configuration.LoaderImageUrl = newConfiguration.loaderImageUrl; configuration.LoaderImageUrl = newConfiguration.loaderImageUrl;
configuration.WeatherCity = newConfiguration.weatherCity; configuration.WeatherCity = newConfiguration.weatherCity;
configuration.WeatherUpdatedDate = null;
configuration.WeatherResult = null;
configuration.IsDate = newConfiguration.isDate; configuration.IsDate = newConfiguration.isDate;
configuration.IsHour = newConfiguration.isHour; configuration.IsHour = newConfiguration.isHour;
@ -235,6 +237,11 @@ namespace ManagerService.Controllers
configuration.LoaderImageId = updatedConfiguration.loaderImageId; configuration.LoaderImageId = updatedConfiguration.loaderImageId;
configuration.LoaderImageUrl = updatedConfiguration.loaderImageUrl; configuration.LoaderImageUrl = updatedConfiguration.loaderImageUrl;
configuration.WeatherCity = updatedConfiguration.weatherCity; configuration.WeatherCity = updatedConfiguration.weatherCity;
if (configuration.WeatherCity != updatedConfiguration.weatherCity)
{
configuration.WeatherUpdatedDate = null;
configuration.WeatherResult = null;
}
configuration.IsDate = updatedConfiguration.isDate; configuration.IsDate = updatedConfiguration.isDate;
configuration.IsHour = updatedConfiguration.isHour; configuration.IsHour = updatedConfiguration.isHour;