Commit 6344538b authored by Brayan Sarmiento's avatar Brayan Sarmiento
Browse files

Initial commit

parents

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Redsis.Clientes.VerifiacionPrecios", "Redsis.Clientes.VerifiacionPrecios\Redsis.Clientes.VerifiacionPrecios.csproj", "{E7CCC019-B10A-47F6-AD94-34DE86B2F169}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Redsis.Clientes.VerificacionPrecios.Core", "Redsis.Clientes.VerificacionPrecios.Core\Redsis.Clientes.VerificacionPrecios.Core.csproj", "{1899CFDB-2681-49B7-A183-A7BC7A6A15C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Redsis.Clientes.VerificarPrecios.Manager", "Redsis.Clientes.VerificarPrecios.Manager\Redsis.Clientes.VerificarPrecios.Manager.csproj", "{88B834CC-1410-4C06-9DCF-67AB744E9309}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E7CCC019-B10A-47F6-AD94-34DE86B2F169}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7CCC019-B10A-47F6-AD94-34DE86B2F169}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7CCC019-B10A-47F6-AD94-34DE86B2F169}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7CCC019-B10A-47F6-AD94-34DE86B2F169}.Release|Any CPU.Build.0 = Release|Any CPU
{1899CFDB-2681-49B7-A183-A7BC7A6A15C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1899CFDB-2681-49B7-A183-A7BC7A6A15C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1899CFDB-2681-49B7-A183-A7BC7A6A15C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1899CFDB-2681-49B7-A183-A7BC7A6A15C6}.Release|Any CPU.Build.0 = Release|Any CPU
{88B834CC-1410-4C06-9DCF-67AB744E9309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88B834CC-1410-4C06-9DCF-67AB744E9309}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88B834CC-1410-4C06-9DCF-67AB744E9309}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88B834CC-1410-4C06-9DCF-67AB744E9309}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4885DFF7-E94A-41DE-B2A1-F42D950CBDD1}
EndGlobalSection
EndGlobal
using Microsoft.AspNetCore.Mvc;
namespace Redsis.Clientes.VerifiacionPrecios.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
}
\ No newline at end of file
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Redsis.Clientes.VerificacionPrecios.Core.Workers;
using Redsis.Clientes.VerificacionPrecios.Core;
using Serilog;
using Redsis.Clientes.VerificacionPrecios.Core.Contratos;
using Redsis.Clientes.VerificarPrecios.Manager;
namespace Redsis.Clientes.VerifiacionPrecios
{
public class Program
{
public static void Main(string[] args)
{
string basePath = (args.Any() && !string.IsNullOrWhiteSpace(args[0]) && Directory.Exists(args[0])) ? args[0] : System.AppDomain.CurrentDomain.BaseDirectory;
var env = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT");
var settings = env == null ? "appsettings.json" : $"appsettings.{env}.json";
Directory.SetCurrentDirectory(basePath);
var configuration = new ConfigurationBuilder()
.SetBasePath(basePath)
.AddJsonFile("appsettings.logs.json")
.AddJsonFile(settings, optional: false, reloadOnChange: false)
.Build();
Log.Logger = new LoggerConfiguration().ReadFrom.Configuration(configuration).CreateLogger().ForContext<Program>();
Log.Information("Iniciando la aplicacion");
Log.Information($"Directorio: {basePath}");
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;
Log.Information($"Version: {version}");
CreateHostBuilder(args, configuration).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args, IConfiguration configuration)
{
return Host.CreateDefaultBuilder(args)
.UseWindowsService()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureServices((hostingContext, services) =>
{
services.AddHostedService<ServiceBrokerWorker>();
services.AddTransient<IVerificarPrecio, VerificarPrecio>();
services.AddTransient<IVerificarGondola, VerificarGondola>();
services.AddTransient<Procesador>();
})
.UseSerilog();
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>false</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>C:\Discod\Aplicaciones Eva\Verificacion de precios\publicaciones</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<_PublishTargetUrl>C:\Discod\Aplicaciones Eva\Verificacion de precios\publicaciones</_PublishTargetUrl>
<History>True|2024-04-24T02:32:40.0349744Z;True|2024-04-23T18:29:45.4378132-05:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
\ No newline at end of file
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:26651",
"sslPort": 44309
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5164",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7181;http://localhost:5164",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.7" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Redsis.Clientes.VerificacionPrecios.Core\Redsis.Clientes.VerificacionPrecios.Core.csproj" />
<ProjectReference Include="..\Redsis.Clientes.VerificarPrecios.Manager\Redsis.Clientes.VerificarPrecios.Manager.csproj" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ActiveDebugProfile>https</ActiveDebugProfile>
<NameOfLastUsedPublishProfile>C:\Discod\Aplicaciones Eva\Verificacion de precios\Redsis.Clientes.VerifiacionPrecios\Redsis.Clientes.VerifiacionPrecios\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup>
</Project>
\ No newline at end of file
namespace Redsis.Clientes.VerifiacionPrecios
{
public class Startup
{
public IConfiguration Configuration { get; set; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder =>
{
builder.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod();
});
});
services.AddControllers();
services.AddEndpointsApiExplorer();
services.AddSwaggerGen();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseSwagger();
app.UseSwaggerUI();
//app.UseHttpsRedirection();
app.UseRouting();
app.UseCors("AllowAll");
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}
namespace Redsis.Clientes.VerifiacionPrecios
{
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}
\ No newline at end of file
{
"ConnectionStrings": {
"EvaConnectionString": "Data Source=localhost;Initial Catalog=procesarCliente;User ID=procesarcliente;Password=123456;TrustServerCertificate=true;",
"SiesaMiddlewareConnection": "Server=planbserver.postgres.database.azure.com:5432;User Id=userplanb;Password=XrQ!V67o8Uxj;Database=planb;Pooling=false;Timeout=300;CommandTimeout=300"
}
}
\ No newline at end of file
{
"ConnectionStrings": {
"EvaConnectionString": "Data Source=localhost;Initial Catalog=procesarCliente;User ID=procesarcliente;Password=123456;TrustServerCertificate=true;",
"SiesaMiddlewareConnection": "Server=pdbgondola01.postgres.database.azure.com:5432;User Id=adminplanb;Password=Pl@nbp@ssW0rd2023;Database=planb;Pooling=false;Timeout=300;CommandTimeout=300"
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment