From 872edac965428221e7d1ad7420d45e045a7f949a Mon Sep 17 00:00:00 2001 From: alfonso Date: Sat, 27 Jan 2024 12:16:31 -0600 Subject: [PATCH] Made proper configuration changes --- .vscode/tasks.json | 23 ++++++++++++++++++++++ Controllers/Utils/FileManagerController.cs | 10 +++++----- appsettings.json | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e8f94ed..29efcdf 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -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", diff --git a/Controllers/Utils/FileManagerController.cs b/Controllers/Utils/FileManagerController.cs index e52fabe..590d96b 100644 --- a/Controllers/Utils/FileManagerController.cs +++ b/Controllers/Utils/FileManagerController.cs @@ -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("AllFiles"); + RootPath = _config.GetValue("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))) diff --git a/appsettings.json b/appsettings.json index 972f05c..6188e26 100644 --- a/appsettings.json +++ b/appsettings.json @@ -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!"