ancora fix deploy IOC
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user