avances
parent
4983028361
commit
95d91394da
|
|
@ -1,14 +1,14 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.configuration;
|
using Mqtt.App.Application.configuration;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.DeleteUser;
|
using Mqtt.App.Application.Persistencia.user.commands.DeleteUser;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetAllUser;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetAllUser;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserById;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserById;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
||||||
using Empresa.App.Application.Sesion.Commands.CreateSesion;
|
using Mqtt.App.Application.Sesion.Commands.CreateSesion;
|
||||||
using Empresa.App.Application.Validators.Sesion;
|
using Mqtt.App.Application.Validators.Sesion;
|
||||||
using Empresa.App.Application.Validators.User;
|
using Mqtt.App.Application.Validators.User;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -16,7 +16,8 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
namespace Empresa.App.Application
|
using Mqtt.App.Application.mqtt;
|
||||||
|
namespace Mqtt.App.Application
|
||||||
{
|
{
|
||||||
public static class DependencyInjectionService
|
public static class DependencyInjectionService
|
||||||
{
|
{
|
||||||
|
|
@ -29,6 +30,8 @@ namespace Empresa.App.Application
|
||||||
);
|
);
|
||||||
#region user
|
#region user
|
||||||
services.AddTransient< IcreateUserCommand,CreateUserCommand>();
|
services.AddTransient< IcreateUserCommand,CreateUserCommand>();
|
||||||
|
services.AddTransient<IMqttAppService, MqttAppService>();
|
||||||
|
|
||||||
services.AddTransient<IupdateUserCommand, UpdateUserCommand>();
|
services.AddTransient<IupdateUserCommand, UpdateUserCommand>();
|
||||||
services.AddTransient<IDeleteUserCommand, DeleteUserCommand>();
|
services.AddTransient<IDeleteUserCommand, DeleteUserCommand>();
|
||||||
services.AddTransient<IGetUserByIdQuery, GetUserByIdQuery>();
|
services.AddTransient<IGetUserByIdQuery, GetUserByIdQuery>();
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
using Empresa.App.Application.Features;
|
using Mqtt.App.Application.Features;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.Filters;
|
using Microsoft.AspNetCore.Mvc.Filters;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Exceptions
|
namespace Mqtt.App.Application.Exceptions
|
||||||
{
|
{
|
||||||
//captura errores
|
//captura errores
|
||||||
public class ExceptionManager : IExceptionFilter
|
public class ExceptionManager : IExceptionFilter
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using Empresa.App.Domain.Models;
|
using Mqtt.App.Domain.Models;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Features
|
namespace Mqtt.App.Application.Features
|
||||||
{
|
{
|
||||||
public static class ResponseApiService
|
public static class ResponseApiService
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Interfaces.External
|
namespace Mqtt.App.Application.Interfaces.External
|
||||||
{
|
{
|
||||||
public interface IGetTokenJwtService
|
public interface IGetTokenJwtService
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Mqtt.App.Application.Interfaces.External
|
||||||
|
{
|
||||||
|
public interface IMqttService
|
||||||
|
{
|
||||||
|
Task<bool> publishAsync(string topic, string payload);
|
||||||
|
public bool CompruebaKey(string key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Interfaces
|
namespace Mqtt.App.Application.Interfaces
|
||||||
{
|
{
|
||||||
//servicion para guardar datos
|
//servicion para guardar datos
|
||||||
public interface IPersistenciaService
|
public interface IPersistenciaService
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetAllUser
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetAllUser
|
||||||
{
|
{
|
||||||
public class GetAllUserModel
|
public class GetAllUserModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetAllUser
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetAllUser
|
||||||
{
|
{
|
||||||
public class GetAllUserQuery: IGetAllUserQuery
|
public class GetAllUserQuery: IGetAllUserQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetAllUser
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetAllUser
|
||||||
{
|
{
|
||||||
public interface IGetAllUserQuery
|
public interface IGetAllUserQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetUserById
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetUserById
|
||||||
{
|
{
|
||||||
public class GetUserByIdModel
|
public class GetUserByIdModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -9,7 +9,7 @@ using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetUserById
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetUserById
|
||||||
{
|
{
|
||||||
public class GetUserByIdQuery: IGetUserByIdQuery
|
public class GetUserByIdQuery: IGetUserByIdQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetAllUser;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetAllUser;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetUserById
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetUserById
|
||||||
{
|
{
|
||||||
public interface IGetUserByIdQuery
|
public interface IGetUserByIdQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetUserByPassAndName
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetUserByPassAndName
|
||||||
{
|
{
|
||||||
public class GetUserByPassAndNameModel
|
public class GetUserByPassAndNameModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserById;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserById;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -8,7 +8,7 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetUserByPassAndName
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetUserByPassAndName
|
||||||
{
|
{
|
||||||
public class GetUserByPassAndNameQuery: IGetUserByPassAndNameQuery
|
public class GetUserByPassAndNameQuery: IGetUserByPassAndNameQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.Queries.GetUserByPassAndName
|
namespace Mqtt.App.Application.Persistencia.user.Queries.GetUserByPassAndName
|
||||||
{
|
{
|
||||||
public interface IGetUserByPassAndNameQuery
|
public interface IGetUserByPassAndNameQuery
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.CreateUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.CreateUser
|
||||||
{
|
{
|
||||||
public class CreateUserCommand: IcreateUserCommand
|
public class CreateUserCommand: IcreateUserCommand
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.CreateUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.CreateUser
|
||||||
{
|
{
|
||||||
public class CreateUserModel
|
public class CreateUserModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.CreateUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.CreateUser
|
||||||
{
|
{
|
||||||
public interface IcreateUserCommand
|
public interface IcreateUserCommand
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.DeleteUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.DeleteUser
|
||||||
{
|
{
|
||||||
public class DeleteUserCommand: IDeleteUserCommand
|
public class DeleteUserCommand: IDeleteUserCommand
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.DeleteUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.DeleteUser
|
||||||
{
|
{
|
||||||
public interface IDeleteUserCommand
|
public interface IDeleteUserCommand
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.UpdateUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.UpdateUser
|
||||||
{
|
{
|
||||||
public interface IupdateUserCommand
|
public interface IupdateUserCommand
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.UpdateUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.UpdateUser
|
||||||
{
|
{
|
||||||
public class UpdateUserCommand : IupdateUserCommand
|
public class UpdateUserCommand : IupdateUserCommand
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Persistencia.user.commands.UpdateUser
|
namespace Mqtt.App.Application.Persistencia.user.commands.UpdateUser
|
||||||
{
|
{
|
||||||
public class UpdateUserModel
|
public class UpdateUserModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Application.Interfaces.External;
|
using Mqtt.App.Application.Interfaces.External;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Sesion.Commands.CreateSesion
|
namespace Mqtt.App.Application.Sesion.Commands.CreateSesion
|
||||||
{
|
{
|
||||||
public class CreateSesionCommand: ICreateSesionCommand
|
public class CreateSesionCommand: ICreateSesionCommand
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Sesion.Commands.CreateSesion
|
namespace Mqtt.App.Application.Sesion.Commands.CreateSesion
|
||||||
{
|
{
|
||||||
public class CreateSesionModel
|
public class CreateSesionModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Sesion.Commands.CreateSesion
|
namespace Mqtt.App.Application.Sesion.Commands.CreateSesion
|
||||||
{
|
{
|
||||||
public interface ICreateSesionCommand
|
public interface ICreateSesionCommand
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Sesion.Commands.CreateSesion
|
namespace Mqtt.App.Application.Sesion.Commands.CreateSesion
|
||||||
{
|
{
|
||||||
public class InCreateSesionModel
|
public class InCreateSesionModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application.Sesion.Commands.CreateSesion;
|
using Mqtt.App.Application.Sesion.Commands.CreateSesion;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Validators.Sesion
|
namespace Mqtt.App.Application.Validators.Sesion
|
||||||
{
|
{
|
||||||
public class InCreateSesionValidator : AbstractValidator<InCreateSesionModel>
|
public class InCreateSesionValidator : AbstractValidator<InCreateSesionModel>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Validators.User
|
namespace Mqtt.App.Application.Validators.User
|
||||||
{
|
{
|
||||||
public class CreateUserValidator:AbstractValidator<CreateUserModel>
|
public class CreateUserValidator:AbstractValidator<CreateUserModel>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Validators.User
|
namespace Mqtt.App.Application.Validators.User
|
||||||
{
|
{
|
||||||
public class GetUserByPassAndNameValidator : AbstractValidator<(string, string)>
|
public class GetUserByPassAndNameValidator : AbstractValidator<(string, string)>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.Validators.User
|
namespace Mqtt.App.Application.Validators.User
|
||||||
{
|
{
|
||||||
public class UpdateUserValidator : AbstractValidator<UpdateUserModel>
|
public class UpdateUserValidator : AbstractValidator<UpdateUserModel>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetAllUser;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetAllUser;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserById;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserById;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Application.configuration
|
namespace Mqtt.App.Application.configuration
|
||||||
{
|
{
|
||||||
public class MapperProfile : Profile
|
public class MapperProfile : Profile
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Mqtt.App.Application.mqtt
|
||||||
|
{
|
||||||
|
public interface IMqttAppService
|
||||||
|
{
|
||||||
|
Task<bool> Publica(mqttPublish data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using Mqtt.App.Application.Interfaces.External;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Mqtt.App.Application.mqtt
|
||||||
|
{
|
||||||
|
public class MqttAppService: IMqttAppService
|
||||||
|
{
|
||||||
|
private readonly IMqttService _mqttService;
|
||||||
|
|
||||||
|
public MqttAppService(IMqttService mqttService)
|
||||||
|
{
|
||||||
|
_mqttService=mqttService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> Publica(mqttPublish data)
|
||||||
|
{
|
||||||
|
return CompruebaKey(data) && await _mqttService.publishAsync(data.topic, data.payload);
|
||||||
|
}
|
||||||
|
internal bool CompruebaKey(MqttBase data)
|
||||||
|
{
|
||||||
|
return _mqttService.CompruebaKey(data.key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Mqtt.App.Application.mqtt
|
||||||
|
{
|
||||||
|
public class MqttBase
|
||||||
|
{
|
||||||
|
public string key { get; set; }
|
||||||
|
public string topic { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Mqtt.App.Application.mqtt
|
||||||
|
{
|
||||||
|
public class mqttPublish : MqttBase
|
||||||
|
{
|
||||||
|
public string payload {get; set;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Common
|
namespace Mqtt.App.Common
|
||||||
{
|
{
|
||||||
public static class DependencyInjectionService
|
public static class DependencyInjectionService
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
using Empresa.App.Domain.Enums;
|
using Mqtt.App.Domain.Enums;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Domain.Entities.Booking
|
namespace Mqtt.App.Domain.Entities.Booking
|
||||||
{
|
{
|
||||||
public class BookingEntity
|
public class BookingEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Domain.Entities.Customer
|
namespace Mqtt.App.Domain.Entities.Customer
|
||||||
{
|
{
|
||||||
public class CustomerEntity
|
public class CustomerEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Domain.Entities.User
|
namespace Mqtt.App.Domain.Entities.User
|
||||||
{
|
{
|
||||||
public class UserEntity
|
public class UserEntity
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.Domain.Enums
|
namespace Mqtt.App.Domain.Enums
|
||||||
{
|
{
|
||||||
public enum BookingType
|
public enum BookingType
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
namespace Empresa.App.Domain.Models
|
namespace Mqtt.App.Domain.Models
|
||||||
{
|
{
|
||||||
public class BaseResponseModel
|
public class BaseResponseModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using Empresa.App.Application.Interfaces.External;
|
using Mqtt.App.Application.Interfaces.External;
|
||||||
using Empresa.App.External.GetTokenJWT;
|
using Mqtt.App.External.GetTokenJWT;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
@ -11,8 +11,9 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Mqtt.App.External.Mqtt;
|
||||||
|
|
||||||
namespace Empresa.App.External
|
namespace Mqtt.App.External
|
||||||
{
|
{
|
||||||
public static class DependencyInjectionService
|
public static class DependencyInjectionService
|
||||||
{
|
{
|
||||||
|
|
@ -20,6 +21,8 @@ namespace Empresa.App.External
|
||||||
{
|
{
|
||||||
|
|
||||||
services.AddSingleton<IGetTokenJwtService, GetTokenJwtService>();
|
services.AddSingleton<IGetTokenJwtService, GetTokenJwtService>();
|
||||||
|
services.AddSingleton<IMqttService, MqttService>();
|
||||||
|
|
||||||
|
|
||||||
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(option =>
|
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(option =>
|
||||||
option.TokenValidationParameters=new TokenValidationParameters
|
option.TokenValidationParameters=new TokenValidationParameters
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Empresa.App.Application.Interfaces.External;
|
using Mqtt.App.Application.Interfaces.External;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -9,7 +9,7 @@ using System.Security.Claims;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.App.External.GetTokenJWT
|
namespace Mqtt.App.External.GetTokenJWT
|
||||||
{
|
{
|
||||||
public class GetTokenJwtService: IGetTokenJwtService
|
public class GetTokenJwtService: IGetTokenJwtService
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
|
||||||
|
<PackageReference Include="MQTTnet" Version="5.0.1.1416" />
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.1.2" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.1.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MQTTnet;
|
||||||
|
using System.Buffers;
|
||||||
|
using System.Text;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using Microsoft.AspNetCore.Hosting.Server;
|
||||||
|
using Mqtt.App.Application.Interfaces.External;
|
||||||
|
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||||
|
namespace Mqtt.App.External.Mqtt
|
||||||
|
{
|
||||||
|
public class MqttService: IMqttService
|
||||||
|
{
|
||||||
|
private readonly IConfiguration _config;
|
||||||
|
|
||||||
|
public MqttService(IConfiguration config)
|
||||||
|
{
|
||||||
|
_config = config;
|
||||||
|
}
|
||||||
|
public bool CompruebaKey(string key)
|
||||||
|
{
|
||||||
|
if(_config == null )
|
||||||
|
return false;
|
||||||
|
string apikey = _config["ApiKeyMqtt"];
|
||||||
|
if (String.IsNullOrWhiteSpace(apikey) || String.IsNullOrWhiteSpace(key))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return apikey.Equals(key);
|
||||||
|
|
||||||
|
}
|
||||||
|
public async Task<bool> publishAsync(string topic, string payload)
|
||||||
|
{
|
||||||
|
if (_config == null || String.IsNullOrWhiteSpace(topic) || String.IsNullOrWhiteSpace(payload))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
string server = _config["ServerMqtt"];
|
||||||
|
string topicFormat = _config["TopicFormatMqtt"];
|
||||||
|
|
||||||
|
if (String.IsNullOrWhiteSpace(server) || String.IsNullOrWhiteSpace(topicFormat))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool res = true;
|
||||||
|
var mqttFactory = new MqttClientFactory();
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(payload);
|
||||||
|
|
||||||
|
using (var mqttClient = mqttFactory.CreateMqttClient())
|
||||||
|
{
|
||||||
|
var mqttClientOptions = new MqttClientOptionsBuilder().WithTcpServer(server).Build();
|
||||||
|
|
||||||
|
// Setup message handling before connecting so that queued messages
|
||||||
|
// are also handled properly. When there is no event handler attached all
|
||||||
|
// received messages get lost.
|
||||||
|
|
||||||
|
var conect = await mqttClient.ConnectAsync(mqttClientOptions, CancellationToken.None);
|
||||||
|
res = conect.ResultCode == MqttClientConnectResultCode.Success;
|
||||||
|
if (res)
|
||||||
|
{
|
||||||
|
MqttClientPublishResult resultPublish = await mqttClient.PublishAsync(new MqttApplicationMessage
|
||||||
|
{
|
||||||
|
Topic = string.Format(topicFormat, topic),
|
||||||
|
Payload = new ReadOnlySequence<byte>(bytes)
|
||||||
|
});
|
||||||
|
res = resultPublish.IsSuccess;
|
||||||
|
await mqttClient.DisconnectAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
using Empresa.App.Application.Features;
|
using Mqtt.App.Application.Features;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application.Sesion.Commands.CreateSesion;
|
using Mqtt.App.Application.Sesion.Commands.CreateSesion;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
//using System.Web.Http;
|
//using System.Web.Http;
|
||||||
|
|
||||||
namespace Empresa.App.api.Controllers
|
namespace Mqtt.App.api.Controllers
|
||||||
{
|
{
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[Route("api/v1/Sesion")]
|
[Route("api/v1/Sesion")]
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
using Empresa.App.Application.Exceptions;
|
using Mqtt.App.Application.Exceptions;
|
||||||
using Empresa.App.Application.Features;
|
using Mqtt.App.Application.Features;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.DeleteUser;
|
using Mqtt.App.Application.Persistencia.user.commands.DeleteUser;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.UpdateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.UpdateUser;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetAllUser;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetAllUser;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserById;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserById;
|
||||||
using Empresa.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
using Mqtt.App.Application.Persistencia.user.Queries.GetUserByPassAndName;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
|
|
@ -14,7 +14,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
//using System.Web.Http;
|
//using System.Web.Http;
|
||||||
|
|
||||||
namespace Empresa.App.api.Controllers
|
namespace Mqtt.App.api.Controllers
|
||||||
{
|
{
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[Route("api/v1/User")]
|
[Route("api/v1/User")]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
using FluentValidation;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Mqtt.App.Application.Features;
|
||||||
|
using Mqtt.App.Application.mqtt;
|
||||||
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
|
|
||||||
|
namespace Mqtt.App.api.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/v1/mqtt")]
|
||||||
|
[ApiController]
|
||||||
|
public class mqttController : ControllerBase
|
||||||
|
{
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IActionResult> Create(
|
||||||
|
[FromBody] mqttPublish model,
|
||||||
|
[FromServices] IMqttAppService mqttService
|
||||||
|
)
|
||||||
|
{
|
||||||
|
var data = await mqttService.Publica(model);
|
||||||
|
return StatusCode(StatusCodes.Status201Created, ResponseApiService.Response(StatusCodes.Status201Created, data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Empresa.App.api
|
namespace Mqtt.App.api
|
||||||
{
|
{
|
||||||
//clase de inyeccion de depèndencias
|
//clase de inyeccion de depèndencias
|
||||||
public static class DependencyInjectionService
|
public static class DependencyInjectionService
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Empresa.App.api
|
||||||
option.SwaggerDoc("v1", new OpenApiInfo
|
option.SwaggerDoc("v1", new OpenApiInfo
|
||||||
{
|
{
|
||||||
Version = "v1",
|
Version = "v1",
|
||||||
Title = "Empresa.App.api",
|
Title = "Mqtt.App.api",
|
||||||
Description = "Plantilla generica para apis"
|
Description = "Plantilla generica para apis"
|
||||||
});
|
});
|
||||||
//parametros de seguridad-----------------------------------
|
//parametros de seguridad-----------------------------------
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,7 @@
|
||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<NameOfLastUsedPublishProfile>F:\desa\v2022\PlantillaApiNet8\Empresa.app\src\Empresa.App.api\Properties\PublishProfiles\ParaDocker.pubxml</NameOfLastUsedPublishProfile>
|
<NameOfLastUsedPublishProfile>F:\desa\v2022\PlantillaApiNet8\Empresa.app\src\Empresa.App.api\Properties\PublishProfiles\ParaDocker.pubxml</NameOfLastUsedPublishProfile>
|
||||||
|
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||||
|
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
@Empresa.App.api_HostAddress = http://localhost:5181
|
@Mqtt.App.api_HostAddress = http://localhost:5181
|
||||||
|
|
||||||
GET {{Empresa.App.api_HostAddress}}/weatherforecast/
|
GET {{Mqtt.App.api_HostAddress}}/weatherforecast/
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
using Empresa.App.api;
|
using Mqtt.App.api;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Common;
|
using Mqtt.App.Common;
|
||||||
using Empresa.app.Persistencia;
|
using Mqtt.App.Persistencia;
|
||||||
using Empresa.App.External;
|
using Mqtt.App.External;
|
||||||
using Empresa.App.Application.Persistencia.user.commands.CreateUser;
|
using Mqtt.App.Application.Persistencia.user.commands.CreateUser;
|
||||||
using Empresa.App.Application;
|
using Mqtt.App.Application;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.app.Persistencia.Configurations
|
namespace Mqtt.App.Persistencia.Configurations
|
||||||
{
|
{
|
||||||
public class UserConfiguration
|
public class UserConfiguration
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using Empresa.app.Persistencia.Services;
|
using Mqtt.App.Persistencia.Services;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -9,7 +9,7 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
namespace Empresa.app.Persistencia
|
namespace Mqtt.App.Persistencia
|
||||||
{
|
{
|
||||||
public static class DependencyInjectionService
|
public static class DependencyInjectionService
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using Empresa.app.Persistencia.Configurations;
|
using Mqtt.App.Persistencia.Configurations;
|
||||||
using Empresa.App.Application.Interfaces;
|
using Mqtt.App.Application.Interfaces;
|
||||||
using Empresa.App.Domain.Entities.User;
|
using Mqtt.App.Domain.Entities.User;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -8,7 +8,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Empresa.app.Persistencia.Services
|
namespace Mqtt.App.Persistencia.Services
|
||||||
{
|
{
|
||||||
public class PersistenciaService : DbContext, IPersistenciaService
|
public class PersistenciaService : DbContext, IPersistenciaService
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue