Made proper configuration changes

main
alfonso 8 months ago
parent 54994bf4f4
commit 872edac965
  1. 23
      .vscode/tasks.json
  2. 10
      Controllers/Utils/FileManagerController.cs
  3. 2
      appsettings.json

23
.vscode/tasks.json vendored

@ -1,6 +1,29 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "publish for PRODUCTION : AOLBackend",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"/property:Configuration=Release",
"/property:EnvironmentName=Production",
"${workspaceFolder}/AOLBackend.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false,
"close": true
},
"problemMatcher": "$msCompile"
},
{
"label": "build",
"command": "dotnet",

@ -12,7 +12,7 @@ namespace AOLBackend.Controllers.Utils
private readonly IFileManagerRepository _Repo;
private readonly IFilePaths4ProcessRepository _RepoRelativePath;
private readonly IConfiguration _config;
private readonly string RootPathCorresponsales;
private readonly string RootPath;
public FileManagerController(IFileManagerRepository Repo,
IFilePaths4ProcessRepository RepoRelativePath,
IConfiguration config)
@ -20,7 +20,7 @@ namespace AOLBackend.Controllers.Utils
_config = config;
_Repo = Repo;
_RepoRelativePath = RepoRelativePath;
RootPathCorresponsales = _config.GetValue<string>("AllFiles");
RootPath = _config.GetValue<string>("AllFiles");
}
[Route("GetFileInfoByProcess")]
@ -48,7 +48,7 @@ namespace AOLBackend.Controllers.Utils
DateTime time = DateTime.Now;
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
string fullPath = "";
fullPath = RootPathCorresponsales + RelativePath.Path;
fullPath = RootPath + RelativePath.Path;
string fileMime = file.FileName.Substring(file.FileName.Length - 4);
string newFileName = file.FileName.Replace(fileMime, "") + "_" + time.ToString("yyyy_MM_dd_HH_mm_ss") + fileMime;
FileManager data = new FileManager();
@ -89,7 +89,7 @@ namespace AOLBackend.Controllers.Utils
FileManager recFound = await _Repo.getFileByProcess(id, Proceso);
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
string fullPath = "";
fullPath = RootPathCorresponsales + RelativePath.Path;
fullPath = RootPath + RelativePath.Path;
if (!String.IsNullOrEmpty(recFound.NombreArchivo))
{
try
@ -126,7 +126,7 @@ namespace AOLBackend.Controllers.Utils
FileManager Found = await _Repo.getFileById(id);
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Found.Proceso);
string fullPath = "";
fullPath = RootPathCorresponsales + RelativePath.Path;
fullPath = RootPath + RelativePath.Path;
try
{
if (System.IO.File.Exists(Path.Combine(fullPath, Found.NombreArchivo)))

@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"SqlConnection": "server=localhost; database=AOL; User Id=sa;Password=toor1234;Encrypt=False;",
"MySQLConnection": "Server=127.0.0.1; User ID=sa; Password=toor1234; Port=3360; Database=AOL"
"MySQLConnection": "Server=172.25.194.179; User ID=root; Password=toor1234; Database=aol"
},
"DefaultUser": {
"Password": "Bienvenido123!"

Loading…
Cancel
Save