ancora fix deploy IOC
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MP.IOC.Data;
|
||||
using NLog;
|
||||
|
||||
namespace MP.IOC.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class RecipeArchiveController : ControllerBase
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public RecipeArchiveController(IConfiguration configuration, MpDataService DataService)
|
||||
{
|
||||
Log.Info("Starting RecipeArchiveController");
|
||||
_configuration = configuration;
|
||||
DService = DataService;
|
||||
Log.Info("Avviata classe RecipeArchiveController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
[HttpGet("GetByPODL")]
|
||||
public async Task<string> GetByPODL(string idxMacc, int idxPODL)
|
||||
{
|
||||
string answ = "";
|
||||
string archPath = await DService.MacchineRecipeArchive(idxMacc);
|
||||
var podlData = await DService.POdlGetByKey(idxPODL);
|
||||
if (podlData != null)
|
||||
{
|
||||
string fileName = podlData?.Recipe ?? "";
|
||||
string fullPath = Path.Combine(archPath, fileName);
|
||||
if (!string.IsNullOrEmpty(fullPath))
|
||||
{
|
||||
answ = System.IO.File.ReadAllText(fullPath);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
[HttpGet("GetFile")]
|
||||
public async Task<string> GetFile(string idxMacc, string fileName)
|
||||
{
|
||||
string answ = "";
|
||||
string archPath = await DService.MacchineRecipeArchive(idxMacc);
|
||||
if (!string.IsNullOrEmpty(archPath))
|
||||
{
|
||||
string fullPath = Path.Combine(archPath, fileName);
|
||||
if (!string.IsNullOrEmpty(fullPath))
|
||||
{
|
||||
answ = System.IO.File.ReadAllText(fullPath);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected MpDataService DService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
+169
-134
@@ -818,109 +818,6 @@ namespace MP.IOC.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elenco TUTTI gli ODL
|
||||
/// </summary>
|
||||
/// <param name="IdxOdl"></param>
|
||||
/// <returns></returns>
|
||||
public List<ODLModel> ListOdlAll()
|
||||
{
|
||||
List<ODLModel>? result = new List<ODLModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
result = SpecDbController.ListOdlAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ListOdlAll | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ODL filtrati x stato, articolo, KeyRich (che contiene stato)
|
||||
/// </summary>
|
||||
/// <param name="inCorso">Stato ODL: true=in corso/completato</param>
|
||||
/// <param name="codArt">Cod articolo</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <param name="Reparto">Reparto selezionato</param>
|
||||
/// <param name="IdxMacchina">Macchina selezionata</param>
|
||||
/// <param name="startDate">Data inizio</param>
|
||||
/// <param name="endDate">Data fine</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ODLExpModel>> ListODLFilt(bool inCorso, string codArt, string keyRichPart, string Reparto, string IdxMacchina, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
List<ODLExpModel>? result = new List<ODLExpModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{Utils.redisOdlList}:{inCorso}:{codArt}:{keyRichPart}:{Reparto}:{IdxMacchina}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<ODLExpModel>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(SpecDbController.ListODLFilt(inCorso, codArt, keyRichPart, Reparto, IdxMacchina, startDate, endDate));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<ODLExpModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ListODLFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
|
||||
//return await Task.FromResult(SpecDbController.ListODLFilt(inCorso, codArt, keyRichPart, Reparto, IdxMacchina, startDate, endDate));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
|
||||
/// </summary>
|
||||
/// <param name="lanciato">Solo lanciati (1) o ancora disponibili (0)</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <param name="idxMacchina">Macchina</param>
|
||||
/// <param name="codGruppo">Gruppo</param>
|
||||
/// <param name="startDate">Data inizio</param>
|
||||
/// <param name="endDate">Data fine</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<PODLExpModel>> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
List<PODLExpModel>? result = new List<PODLExpModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{Utils.redisPOdlList}:{codGruppo}:{idxMacchina}:{keyRichPart}:{lanciato}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<PODLExpModel>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(SpecDbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<PODLExpModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ListPODLFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco completo valori Macchine 2 Slave
|
||||
/// </summary>
|
||||
@@ -994,17 +891,52 @@ namespace MP.IOC.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina abbia un codice ricetta associato
|
||||
/// Verifica se la macchina abbia un codice PATH ricette associato
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> MacchineRecipe(string idxMacchina)
|
||||
public async Task<string> MacchineRecipeArchive(string idxMacchina)
|
||||
{
|
||||
string? result = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{Utils.redisMacRecipe}:{idxMacchina}";
|
||||
string currKey = $"{Utils.redisMacRecipePath}:{idxMacchina}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<string>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
//recupero elenco macchine...
|
||||
var machineList = await MacchineGetFilt("*");
|
||||
var currMach = machineList.Where(x => x.IdxMacchina == idxMacchina).FirstOrDefault();
|
||||
result = currMach != null ? currMach.RecipeArchivePath : null;
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"MacchineRecipeArchive | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result ?? "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina abbia un codice ricetta associato
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> MacchineRecipeConf(string idxMacchina)
|
||||
{
|
||||
string? result = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{Utils.redisMacRecipeConf}:{idxMacchina}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
@@ -1271,6 +1203,68 @@ namespace MP.IOC.Data
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elenco TUTTI gli ODL
|
||||
/// </summary>
|
||||
/// <param name="IdxOdl"></param>
|
||||
/// <returns></returns>
|
||||
public List<ODLModel> OdlListAll()
|
||||
{
|
||||
List<ODLModel>? result = new List<ODLModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
result = SpecDbController.OdlListAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"OdlListAll | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ODL filtrati x stato, articolo, KeyRich (che contiene stato)
|
||||
/// </summary>
|
||||
/// <param name="inCorso">Stato ODL: true=in corso/completato</param>
|
||||
/// <param name="codArt">Cod articolo</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <param name="Reparto">Reparto selezionato</param>
|
||||
/// <param name="IdxMacchina">Macchina selezionata</param>
|
||||
/// <param name="startDate">Data inizio</param>
|
||||
/// <param name="endDate">Data fine</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ODLExpModel>> OdlListGetFilt(bool inCorso, string codArt, string keyRichPart, string Reparto, string IdxMacchina, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
List<ODLExpModel>? result = new List<ODLExpModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{Utils.redisOdlList}:{inCorso}:{codArt}:{keyRichPart}:{Reparto}:{IdxMacchina}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<ODLExpModel>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(SpecDbController.ListODLFilt(inCorso, codArt, keyRichPart, Reparto, IdxMacchina, startDate, endDate));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<ODLExpModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"OdlListGetFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
|
||||
//return await Task.FromResult(SpecDbController.OdlListGetFilt(inCorso, codArt, keyRichPart, Reparto, IdxMacchina, startDate, endDate));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco di tutti i parametri filtrati x macchina
|
||||
/// </summary>
|
||||
@@ -1307,12 +1301,42 @@ namespace MP.IOC.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLDeleteRecord(PODLExpModel currRec)
|
||||
{
|
||||
var dbResult = await SpecDbController.PODLDeleteRecord(currRec);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisXdlData}:*");
|
||||
bool answ = await RedisFlushPatternAsync(pattern);
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Avvio fase setup per il record selezionato
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> POdlDoSetup(PODLExpModel currRec)
|
||||
{
|
||||
var dbResult = await SpecDbController.PODL_startSetup(currRec, 0, 1, 1, "");
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisXdlData}:*");
|
||||
bool answ = await RedisFlushPatternAsync(pattern);
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero PODL da chiave
|
||||
/// </summary>
|
||||
/// <param name="idxPODL"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PODLModel> PODL_getByKey(int idxPODL)
|
||||
public async Task<PODLModel> POdlGetByKey(int idxPODL)
|
||||
{
|
||||
PODLModel result = new PODLModel();
|
||||
if (idxPODL != 0)
|
||||
@@ -1345,7 +1369,7 @@ namespace MP.IOC.Data
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"PODL_getByKey | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
Log.Trace($"POdlGetByKey | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1359,7 +1383,7 @@ namespace MP.IOC.Data
|
||||
/// </summary>
|
||||
/// <param name="idxODL"></param>
|
||||
/// <returns></returns>
|
||||
public PODLModel PODL_getByOdl(int idxODL)
|
||||
public PODLModel POdlGetByOdl(int idxODL)
|
||||
{
|
||||
PODLModel result = new PODLModel();
|
||||
if (idxODL != 0)
|
||||
@@ -1392,7 +1416,7 @@ namespace MP.IOC.Data
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"PODL_getByOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
Log.Trace($"POdlGetByOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1402,33 +1426,44 @@ namespace MP.IOC.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato
|
||||
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <param name="lanciato">Solo lanciati (1) o ancora disponibili (0)</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <param name="idxMacchina">Macchina</param>
|
||||
/// <param name="codGruppo">Gruppo</param>
|
||||
/// <param name="startDate">Data inizio</param>
|
||||
/// <param name="endDate">Data fine</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLDeleteRecord(PODLExpModel currRec)
|
||||
public async Task<List<PODLExpModel>> POdlListGetFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
var dbResult = await SpecDbController.PODLDeleteRecord(currRec);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisXdlData}:*");
|
||||
bool answ = await RedisFlushPatternAsync(pattern);
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Avvio fase setup per il record selezionato
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> POdlDoSetup(PODLExpModel currRec)
|
||||
{
|
||||
var dbResult = await SpecDbController.PODL_startSetup(currRec, 0, 1, 1, "");
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{Utils.redisXdlData}:*");
|
||||
bool answ = await RedisFlushPatternAsync(pattern);
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
List<PODLExpModel>? result = new List<PODLExpModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{Utils.redisPOdlList}:{codGruppo}:{idxMacchina}:{keyRichPart}:{lanciato}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<PODLExpModel>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(SpecDbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<PODLExpModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"POdlListGetFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS04.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Properties\PublishProfiles\IISProfile.pubxml.user" />
|
||||
<None Include="wwwroot\images\LogoBlu.svg" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ by editing this MSBuild file. In order to learn more about this please visit htt
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
||||
<DesktopBuildPackageLocation>bin\publish\MP.SPEC.zip</DesktopBuildPackageLocation>
|
||||
<DesktopBuildPackageLocation>bin\publish\MP.IOC.zip</DesktopBuildPackageLocation>
|
||||
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||
<DeployIisAppPath>Default Web Site/MP/SPEC</DeployIisAppPath>
|
||||
<DeployIisAppPath>Default Web Site/MP/IOC</DeployIisAppPath>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<SelfContained>false</SelfContained>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MP-IOC </i>
|
||||
<h4>Versione: 6.16.2302.1609</h4>
|
||||
<h4>Versione: 6.16.2304.416</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2302.1609
|
||||
6.16.2304.416
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2302.1609</version>
|
||||
<version>6.16.2304.416</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.MgModels;
|
||||
using MP.SPEC.Data;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Xml;
|
||||
|
||||
namespace MP.SPEC.Controllers
|
||||
{
|
||||
@@ -15,10 +10,7 @@ namespace MP.SPEC.Controllers
|
||||
[AllowAnonymous]
|
||||
public class RecipeArchiveController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected MpDataService DService { get; set; }
|
||||
#region Public Constructors
|
||||
|
||||
public RecipeArchiveController(IConfiguration configuration, MpDataService DataService)
|
||||
{
|
||||
@@ -26,27 +18,12 @@ namespace MP.SPEC.Controllers
|
||||
_configuration = configuration;
|
||||
DService = DataService;
|
||||
Log.Info("Avviata classe RecipeArchiveController");
|
||||
|
||||
}
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
[HttpGet("GetFile")]
|
||||
public async Task<string> GetFile(string idxMacc, string fileName)
|
||||
{
|
||||
string answ = "";
|
||||
string archPath = await DService.MacchineRecipeArchive(idxMacc);
|
||||
if (!string.IsNullOrEmpty(archPath))
|
||||
{
|
||||
string fullPath = Path.Combine(archPath, fileName);
|
||||
if (!string.IsNullOrEmpty(fullPath))
|
||||
{
|
||||
answ = System.IO.File.ReadAllText(fullPath);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
[HttpGet("GetByPODL")]
|
||||
public async Task<string> GetByPODL(string idxMacc, int idxPODL)
|
||||
{
|
||||
@@ -65,5 +42,39 @@ namespace MP.SPEC.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
[HttpGet("GetFile")]
|
||||
public async Task<string> GetFile(string idxMacc, string fileName)
|
||||
{
|
||||
string answ = "";
|
||||
string archPath = await DService.MacchineRecipeArchive(idxMacc);
|
||||
if (!string.IsNullOrEmpty(archPath))
|
||||
{
|
||||
string fullPath = Path.Combine(archPath, fileName);
|
||||
if (!string.IsNullOrEmpty(fullPath))
|
||||
{
|
||||
answ = System.IO.File.ReadAllText(fullPath);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected MpDataService DService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.MgModels;
|
||||
using MP.SPEC.Data;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
@@ -15,22 +12,19 @@ namespace MP.SPEC.Controllers
|
||||
[AllowAnonymous]
|
||||
public class RecipeController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected MpDataService DService { get; set; }
|
||||
#region Public Constructors
|
||||
|
||||
public RecipeController(IConfiguration configuration, MpDataService DataService)
|
||||
{
|
||||
Log.Info("Starting RecipeController");
|
||||
_configuration = configuration;
|
||||
DService = DataService;
|
||||
Log.Info("Avviata classe Recipe");
|
||||
|
||||
Log.Info("Avviata classe RecipeController");
|
||||
}
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
[HttpGet("GetRecipe")]
|
||||
public async Task<string> GetRecipe(int idxPODL)
|
||||
@@ -43,6 +37,7 @@ namespace MP.SPEC.Controllers
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
[HttpGet("GetRecipeXML")]
|
||||
public async Task<string> GetRecipeXML(int idxPODL)
|
||||
{
|
||||
@@ -58,5 +53,24 @@ namespace MP.SPEC.Controllers
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected MpDataService DService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1679,7 +1679,7 @@ namespace MP.SPEC.Data
|
||||
answ = await RedisFlushPatternAsync(pattern);
|
||||
pattern = new RedisValue($"{Utils.redisPOdlList}:*");
|
||||
answ = await RedisFlushPatternAsync(pattern);
|
||||
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user