Merge branch 'release/FixSwaggerDisplay'

This commit is contained in:
Samuele Locatelli
2022-03-02 19:00:52 +01:00
9 changed files with 115 additions and 122 deletions
+11 -10
View File
@@ -40,19 +40,20 @@ namespace LiMan.Serv
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
if (env.IsDevelopment() || env.IsStaging())
{
app.UseDeveloperExceptionPage();
}
app.UseSwagger(c =>
{
c.RouteTemplate = "/swagger/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("v1/swagger.json", "LiMan.Api");
});
// valido solo in sviluppo
app.UseSwagger(c =>
{
c.RouteTemplate = "/swagger/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("v1/swagger.json", "LiMan.Api");
});
}
app.UseHttpsRedirection();
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 1.1.2202.1114</h4>
<h4>Versione: 1.1.2203.0218</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
1.1.2202.1114
1.1.2203.0218
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2202.1114</version>
<version>1.1.2203.0218</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.Transfer.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+97 -105
View File
@@ -1,4 +1,8 @@
using Microsoft.Extensions.Caching.Distributed;
using Core;
using Core.DTO;
using LiMan.DB.DBModels;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@@ -7,13 +11,8 @@ using NLog;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity.UI.Services;
using Core;
using Core.DTO;
using LiMan.DB.DBModels;
namespace LiMan.UI.Data
{
@@ -41,12 +40,6 @@ namespace LiMan.UI.Data
#endregion Private Fields
#region Protected Fields
protected static string connStringBBM = "";
#endregion Protected Fields
#region Public Fields
public static GLS.Controllers.LicManController dbControllerGLS;
@@ -84,6 +77,16 @@ namespace LiMan.UI.Data
#region Private Methods
/// <summary>
/// Hash Redis contenente i dati MP di una specifico TYPE (es StatusMacchina, StateMachineIngressi, ...)
/// </summary>
/// <param name="dataType"></param>
/// <returns></returns>
private static string mHash(string dataType)
{
return $"DATA:{dataType}";
}
private DistributedCacheEntryOptions cacheOpt(bool fastCache)
{
var numSecAbsExp = fastCache ? chAbsExp : chAbsExp * 10;
@@ -105,17 +108,6 @@ namespace LiMan.UI.Data
#region Internal Methods
/// <summary>
/// Effettua sblocco di una licenza impostando data veto a oggi
/// </summary>
/// <param name="idxSubLic"></param>
/// <returns></returns>
public async Task<bool> AttivazioneUnlock(int idxSubLic)
{
bool fatto = dbControllerNext.AttivazioniUnlock(idxSubLic);
await Task.Delay(1);
return fatto;
}
/// <summary>
/// Effettua sblocco di una licenza impostando data veto a oggi
/// </summary>
@@ -132,16 +124,6 @@ namespace LiMan.UI.Data
#region Public Methods
/// <summary>
/// Hash Redis contenente i dati MP di una specifico TYPE (es StatusMacchina, StateMachineIngressi, ...)
/// </summary>
/// <param name="dataType"></param>
/// <returns></returns>
public static string mHash(string dataType)
{
return $"DATA:{dataType}";
}
public async Task<List<GLS.DatabaseModels.AnagApplicazioni>> ApplicazioniGLSGetAll()
{
List<GLS.DatabaseModels.AnagApplicazioni> dbResult = new List<GLS.DatabaseModels.AnagApplicazioni>();
@@ -224,6 +206,18 @@ namespace LiMan.UI.Data
return await Task.FromResult(done);
}
/// <summary>
/// Effettua sblocco di una licenza impostando data veto a oggi
/// </summary>
/// <param name="idxSubLic"></param>
/// <returns></returns>
public async Task<bool> AttivazioneUnlock(int idxSubLic)
{
bool fatto = dbControllerNext.AttivazioniUnlock(idxSubLic);
await Task.Delay(1);
return fatto;
}
/// <summary>
/// Recupera attivazioni data licenza
/// </summary>
@@ -252,6 +246,23 @@ namespace LiMan.UI.Data
dbControllerGLS.Dispose();
}
/// <summary>
/// Elenco file registrati dato ticket id
/// </summary>
/// <param name="idxTicket">Identificativo del ticket</param>
/// <returns></returns>
public async Task<List<FileAttachModel>> FileGetFilt(int idxTicket)
{
List<FileAttachModel> dbResult = new List<FileAttachModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbControllerNext.FileGetFilt(idxTicket);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per FileGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<List<GLS.DatabaseModels.AnagInstallazioni>> InstallazioniGLSGetAll()
{
List<GLS.DatabaseModels.AnagInstallazioni> dbResult = new List<GLS.DatabaseModels.AnagInstallazioni>();
@@ -540,24 +551,6 @@ namespace LiMan.UI.Data
return await Task.FromResult(dbResult);
}
/// <summary>
/// Elenco file registrati dato ticket id
/// </summary>
/// <param name="idxTicket">Identificativo del ticket</param>
/// <returns></returns>
public async Task<List<FileAttachModel>> FileGetFilt(int idxTicket)
{
List<FileAttachModel> dbResult = new List<FileAttachModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbControllerNext.FileGetFilt(idxTicket);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per FileGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<bool> LicenzeNextUpdate(DB.DBModels.LicenzaModel currItem)
{
bool done = false;
@@ -594,6 +587,59 @@ namespace LiMan.UI.Data
return answ;
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetAll()
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetAll(false, 1000);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetAll: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(SelectNext CurrFilter)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFiltAllLic(CurrFilter.OnlyActive, Core.TipologiaTicket.ND, CurrFilter.ApplicazioneSel, CurrFilter.InstallazioneSel, 1000);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Ricerca ticket filtrati
/// </summary>
/// <param name="onlyOpen"></param>
/// <param name="CodApp"></param>
/// <param name="CodInst"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(bool onlyOpen, string CodApp, string CodInst)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFilt(onlyOpen, CodApp, CodInst);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Aggiornamentos tato ticket
/// </summary>
@@ -615,60 +661,6 @@ namespace LiMan.UI.Data
return await Task.FromResult(fatto);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(SelectNext CurrFilter)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFiltAllLic(CurrFilter.OnlyActive, Core.TipologiaTicket.ND, CurrFilter.ApplicazioneSel, CurrFilter.InstallazioneSel, 1000);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetAll()
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetAll(false, 1000);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetAll: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Ricerca ticket filtrati
/// </summary>
/// <param name="onlyOpen"></param>
/// <param name="CodApp"></param>
/// <param name="CodInst"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(bool onlyOpen,string CodApp, string CodInst)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFilt(onlyOpen,CodApp,CodInst);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
#endregion Public Methods
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>1.1.2202.1114</Version>
<Version>1.1.2203.0218</Version>
<RootNamespace>LiMan.UI</RootNamespace>
<AssemblyName>LiMan.UI</AssemblyName>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 1.1.2202.1114</h4>
<h4>Versione: 1.1.2203.0218</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.1.2202.1114
1.1.2203.0218
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2202.1114</version>
<version>1.1.2203.0218</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>