Files
limanapp/LiMan.DB/DTO/ReleaseDTO.cs
T
Samuele Locatelli e90c52a744 LiMan: ReleasesVers:
- Aggiunta ricerca filtrata per versione minima
- Update API controller
2024-08-06 18:32:36 +02:00

66 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Core.Enum;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace LiMan.DB.DTO
{
public class ReleaseDTO
{
/// <summary>
/// Codice/Nome applicativo
/// </summary>
public string CodApp { get; set; } = "";
/// <summary>
/// Versione applicativo formato semver numerico 4 blocchi
/// </summary>
public string VersNum { get; set; } = "0.0.0.0";
/// <summary>
/// Versione applicativo, formato testuale libero, può essere uguale a VersNum
/// </summary>
public string VersText { get; set; } = "a.b";
/// <summary>
/// Data di release
/// </summary>
public DateTime ReleaseDate { get; set; } = DateTime.Today.AddYears(100);
/// <summary>
/// Url pagina web di changelog (traduzione gestita sul sito target) - calcolato da CodApp + vers
/// </summary>
//public string UrlChangelog { get; set; } = "http://releases.egalware.com";
[NotMapped]
public string UrlChangelog
{
get => $"https://releases.egalware.com/{CodApp}/{VersText}".ToLower();
}
/// <summary>
/// Url pagina web di changelog estesa (traduzione gestita sul sito target) - calcolato da CodApp + vers
/// </summary>
//public string UrlChangelogExt { get; set; } = "http://releases.egalware.com";
[NotMapped]
public string UrlChangelogExt
{
get => $"https://releases.egalware.com/ext_{CodApp}/{VersText}".ToLower();
}
/// <summary>
/// Attivo/Pubblico (qui calcolato, attivo se la data di release è passata, poi potrebbe essere gestito a parte da DB)
/// </summary>
[NotMapped]
public bool IsActive
{
get => (DateTime.Today.Subtract(ReleaseDate).TotalDays >= 0);
}
}
}