diff --git a/.vs/AMAZONBackend/DesignTimeBuild/.dtbcache.v2 b/.vs/AMAZONBackend/DesignTimeBuild/.dtbcache.v2
new file mode 100644
index 0000000..5d124ce
Binary files /dev/null and b/.vs/AMAZONBackend/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/AMAZONBackend/FileContentIndex/1405be82-5dcf-4ebf-9de1-7fa79b7be517.vsidx b/.vs/AMAZONBackend/FileContentIndex/1405be82-5dcf-4ebf-9de1-7fa79b7be517.vsidx
new file mode 100644
index 0000000..8dc7cd2
Binary files /dev/null and b/.vs/AMAZONBackend/FileContentIndex/1405be82-5dcf-4ebf-9de1-7fa79b7be517.vsidx differ
diff --git a/.vs/AMAZONBackend/FileContentIndex/read.lock b/.vs/AMAZONBackend/FileContentIndex/read.lock
new file mode 100644
index 0000000..e69de29
diff --git a/.vs/MyRestFullApiAmazonBackend/config/applicationhost.config b/.vs/AMAZONBackend/config/applicationhost.config
similarity index 100%
rename from .vs/MyRestFullApiAmazonBackend/config/applicationhost.config
rename to .vs/AMAZONBackend/config/applicationhost.config
diff --git a/.vs/AMAZONBackend/v17/.futdcache.v2 b/.vs/AMAZONBackend/v17/.futdcache.v2
new file mode 100644
index 0000000..f627128
Binary files /dev/null and b/.vs/AMAZONBackend/v17/.futdcache.v2 differ
diff --git a/.vs/AMAZONBackend/v17/.suo b/.vs/AMAZONBackend/v17/.suo
new file mode 100644
index 0000000..031f651
Binary files /dev/null and b/.vs/AMAZONBackend/v17/.suo differ
diff --git a/.vs/MyRestFullApiAmazonBackend/DesignTimeBuild/.dtbcache.v2 b/.vs/MyRestFullApiAmazonBackend/DesignTimeBuild/.dtbcache.v2
index d89a7fc..48e5ca0 100644
Binary files a/.vs/MyRestFullApiAmazonBackend/DesignTimeBuild/.dtbcache.v2 and b/.vs/MyRestFullApiAmazonBackend/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/1e5101e5-a686-4432-8f11-b5f57a2db5f4.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/1e5101e5-a686-4432-8f11-b5f57a2db5f4.vsidx
deleted file mode 100644
index 3e6cec5..0000000
Binary files a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/1e5101e5-a686-4432-8f11-b5f57a2db5f4.vsidx and /dev/null differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/367323a3-4d24-4623-bc97-b70821679f77.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/367323a3-4d24-4623-bc97-b70821679f77.vsidx
deleted file mode 100644
index 34d0fd7..0000000
Binary files a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/367323a3-4d24-4623-bc97-b70821679f77.vsidx and /dev/null differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/3ea90be7-e704-4588-a489-9d2e03c3eaa3.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/3ea90be7-e704-4588-a489-9d2e03c3eaa3.vsidx
deleted file mode 100644
index 11d299f..0000000
Binary files a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/3ea90be7-e704-4588-a489-9d2e03c3eaa3.vsidx and /dev/null differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/726075c3-a899-4752-a9b7-4dc39c5ce386.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/726075c3-a899-4752-a9b7-4dc39c5ce386.vsidx
new file mode 100644
index 0000000..7f1b55e
Binary files /dev/null and b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/726075c3-a899-4752-a9b7-4dc39c5ce386.vsidx differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/96891127-c6ba-41a4-b79c-bff99fe5ef1f.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/96891127-c6ba-41a4-b79c-bff99fe5ef1f.vsidx
new file mode 100644
index 0000000..6a509ab
Binary files /dev/null and b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/96891127-c6ba-41a4-b79c-bff99fe5ef1f.vsidx differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/9966c6ff-8d78-4aa8-80fd-ed4ecd02de0c.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/9966c6ff-8d78-4aa8-80fd-ed4ecd02de0c.vsidx
new file mode 100644
index 0000000..33d4383
Binary files /dev/null and b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/9966c6ff-8d78-4aa8-80fd-ed4ecd02de0c.vsidx differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/f3f74f3c-7c8b-4085-902a-ea69099ac72e.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/f3f74f3c-7c8b-4085-902a-ea69099ac72e.vsidx
deleted file mode 100644
index 90a1fe6..0000000
Binary files a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/f3f74f3c-7c8b-4085-902a-ea69099ac72e.vsidx and /dev/null differ
diff --git a/.vs/MyRestFullApiAmazonBackend/FileContentIndex/fd19f70a-fae6-4ddf-bcc0-92c6f0933a12.vsidx b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/fd19f70a-fae6-4ddf-bcc0-92c6f0933a12.vsidx
new file mode 100644
index 0000000..efefee9
Binary files /dev/null and b/.vs/MyRestFullApiAmazonBackend/FileContentIndex/fd19f70a-fae6-4ddf-bcc0-92c6f0933a12.vsidx differ
diff --git a/.vs/MyRestFullApiAmazonBackend/v17/.futdcache.v2 b/.vs/MyRestFullApiAmazonBackend/v17/.futdcache.v2
deleted file mode 100644
index 5d57792..0000000
Binary files a/.vs/MyRestFullApiAmazonBackend/v17/.futdcache.v2 and /dev/null differ
diff --git a/.vs/MyRestFullApiAmazonBackend/v17/.suo b/.vs/MyRestFullApiAmazonBackend/v17/.suo
deleted file mode 100644
index cec11d9..0000000
Binary files a/.vs/MyRestFullApiAmazonBackend/v17/.suo and /dev/null differ
diff --git a/.vs/ProjectEvaluation/amazonbackend.metadata.v5.2 b/.vs/ProjectEvaluation/amazonbackend.metadata.v5.2
new file mode 100644
index 0000000..70125d7
Binary files /dev/null and b/.vs/ProjectEvaluation/amazonbackend.metadata.v5.2 differ
diff --git a/.vs/ProjectEvaluation/amazonbackend.projects.v5.2 b/.vs/ProjectEvaluation/amazonbackend.projects.v5.2
new file mode 100644
index 0000000..330b1c3
Binary files /dev/null and b/.vs/ProjectEvaluation/amazonbackend.projects.v5.2 differ
diff --git a/.vs/ProjectEvaluation/myrestfullapiamazonbackend.metadata.v5.2 b/.vs/ProjectEvaluation/myrestfullapiamazonbackend.metadata.v5.2
index 6037e98..e38d2bd 100644
Binary files a/.vs/ProjectEvaluation/myrestfullapiamazonbackend.metadata.v5.2 and b/.vs/ProjectEvaluation/myrestfullapiamazonbackend.metadata.v5.2 differ
diff --git a/.vs/ProjectEvaluation/myrestfullapiamazonbackend.projects.v5.2 b/.vs/ProjectEvaluation/myrestfullapiamazonbackend.projects.v5.2
index 175fb3b..44cbcc7 100644
Binary files a/.vs/ProjectEvaluation/myrestfullapiamazonbackend.projects.v5.2 and b/.vs/ProjectEvaluation/myrestfullapiamazonbackend.projects.v5.2 differ
diff --git a/MyRestFullApiAmazonBackend.sln b/AMAZONBackend.sln
similarity index 100%
rename from MyRestFullApiAmazonBackend.sln
rename to AMAZONBackend.sln
diff --git a/MyRestFullApiAmazonBackend/AMAZONBackend.csproj b/MyRestFullApiAmazonBackend/AMAZONBackend.csproj
index d26022a..6abd8aa 100644
--- a/MyRestFullApiAmazonBackend/AMAZONBackend.csproj
+++ b/MyRestFullApiAmazonBackend/AMAZONBackend.csproj
@@ -8,17 +8,15 @@
+
+
-
-
-
-
diff --git a/MyRestFullApiAmazonBackend/Contracts/Utils/IPDFGenerator.cs b/MyRestFullApiAmazonBackend/Contracts/Utils/IPDFGenerator.cs
index 6227e39..2864eaa 100644
--- a/MyRestFullApiAmazonBackend/Contracts/Utils/IPDFGenerator.cs
+++ b/MyRestFullApiAmazonBackend/Contracts/Utils/IPDFGenerator.cs
@@ -1,7 +1,9 @@
-namespace MyRestFullApiAmazonBackend.Contracts.Utils
+
+namespace MyRestFullApiAmazonBackend.Contracts.Utils
{
+
public interface IPDFGenerator
{
public Task GeneratePdfFromString(string htmlContent);
}
-}
+}
\ No newline at end of file
diff --git a/MyRestFullApiAmazonBackend/Controllers/AuthController.cs b/MyRestFullApiAmazonBackend/Controllers/AuthController.cs
index ae4b851..02f683f 100644
--- a/MyRestFullApiAmazonBackend/Controllers/AuthController.cs
+++ b/MyRestFullApiAmazonBackend/Controllers/AuthController.cs
@@ -43,7 +43,7 @@ namespace MyRestFullApiAmazonBackend.Controllers
var menu = await _menuRepo.GetItemsMenu(user);
var claims = new List();
var ProfileData = await _perfilesRepo.PerfilGetById(user.Id);
- claims.Add(new Claim(JwtRegisteredClaimNames.Sub, _config["Jwt:Subject"]));
+ claims.Add(new Claim(JwtRegisteredClaimNames.Sub, _config["Jwt:Subject"])); //aqui truena
claims.Add(new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()));
claims.Add(new Claim(JwtRegisteredClaimNames.Iat, DateTime.UtcNow.ToString()));
claims.Add(new Claim("UserId", user.Id.ToString()));
diff --git a/MyRestFullApiAmazonBackend/Crypto/CrypDecrypto.cs b/MyRestFullApiAmazonBackend/Crypto/CrypDecrypto.cs
new file mode 100644
index 0000000..4abc8ed
--- /dev/null
+++ b/MyRestFullApiAmazonBackend/Crypto/CrypDecrypto.cs
@@ -0,0 +1,55 @@
+using System.Security.Cryptography;
+using System.Text;
+
+namespace AMAZONBackend.Crypto
+{
+ public class CryptDecrypt
+ {
+ private readonly static string key = "G3mc0H42hk3y2!0$2*2#n4813dc2h47p";
+ public static string Encrypt(string text)
+ {
+ byte[] iv = new byte[16];
+ byte[] array;
+ using (Aes aes = Aes.Create())
+ {
+ aes.Key = Encoding.UTF8.GetBytes(key);
+ aes.IV = iv;
+ ICryptoTransform encrypt = aes.CreateEncryptor(aes.Key, aes.IV);
+ using (MemoryStream ms = new MemoryStream())
+ {
+ using (CryptoStream cryptoStream = new CryptoStream((Stream)ms, encrypt, CryptoStreamMode.Write))
+ {
+ using (StreamWriter streamWriter = new StreamWriter(cryptoStream))
+ {
+ streamWriter.Write(text);
+ }
+ array = ms.ToArray();
+ }
+ }
+ }
+ return Convert.ToBase64String(array);
+ }
+
+ public static string Decrypt(string text)
+ {
+ byte[] iv = new byte[16];
+ byte[] buffer = Convert.FromBase64String(text);
+ using (Aes aes = Aes.Create())
+ {
+ aes.Key = Encoding.UTF8.GetBytes(key);
+ aes.IV = iv;
+ ICryptoTransform decryptor = aes.CreateDecryptor(aes.Key, aes.IV);
+ using (MemoryStream ms = new MemoryStream(buffer))
+ {
+ using (CryptoStream cryptoStream = new CryptoStream((Stream)ms, decryptor, CryptoStreamMode.Read))
+ {
+ using (StreamReader sr = new StreamReader(cryptoStream))
+ {
+ return sr.ReadToEnd();
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/MyRestFullApiAmazonBackend/Program.cs b/MyRestFullApiAmazonBackend/Program.cs
index 5bfd522..c0cbe7b 100644
--- a/MyRestFullApiAmazonBackend/Program.cs
+++ b/MyRestFullApiAmazonBackend/Program.cs
@@ -1,3 +1,12 @@
+using AMAZONBackend.Repositorio;
+using AMAZONBackend.Services.PDFGenerator.cs;
+using MyRestFullApiAmazonBackend.Clientes.Amazon.Contracts;
+using MyRestFullApiAmazonBackend.Clientes.Amazon.Repository;
+using MyRestFullApiAmazonBackend.Context;
+using MyRestFullApiAmazonBackend.Contracts;
+using MyRestFullApiAmazonBackend.Contracts.Utils;
+using MyRestFullApiAmazonBackend.Services.ValidarFraccion;
+
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
@@ -6,7 +15,20 @@ builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
+builder.Services.AddSingleton();
+builder.Services.AddScoped();
+builder.Services.AddScoped();
+builder.Services.AddScoped();
+
+//Clientes
+builder.Services.AddScoped();
+
+//Utilerias
+
+
+builder.Services.AddScoped();
+builder.Services.AddScoped();
//services cors
builder.Services.AddCors(p => p.AddPolicy("corsapp", builder =>
diff --git a/MyRestFullApiAmazonBackend/Repositorio/MenuRepository.cs b/MyRestFullApiAmazonBackend/Repositorio/MenuRepository.cs
new file mode 100644
index 0000000..a8acc15
--- /dev/null
+++ b/MyRestFullApiAmazonBackend/Repositorio/MenuRepository.cs
@@ -0,0 +1,24 @@
+using Dapper;
+using MyRestFullApiAmazonBackend.Context;
+using MyRestFullApiAmazonBackend.Contracts;
+using MyRestFullApiAmazonBackend.Models;
+using System.Data;
+
+namespace AMAZONBackend.Repositorio
+{
+ public class MenuRepository : IMenuRepository
+ {
+
+ private readonly DapperContext _context;
+ public MenuRepository(DapperContext context) { _context = context; }
+ public async Task> GetItemsMenu(Usuarios user)
+ {
+ var query = "getMenu";
+ using (var connection = _context.CreateConnection())
+ {
+ var menu = await connection.QueryAsync