Compare commits
51 Commits
b78b3e43f4
...
8624742eb3
| Author | SHA1 | Date | |
|---|---|---|---|
| 8624742eb3 | |||
| a27000a75b | |||
| e74ee56f42 | |||
| ac214dc8e1 | |||
| d6b914b9c8 | |||
| d764668cd7 | |||
| 6208a1cf93 | |||
| a7ad55e973 | |||
| 918372371e | |||
| a962299c95 | |||
| cacd5eddbe | |||
| d30feb6034 | |||
| c6f2437300 | |||
| 46664d62ba | |||
| 4d6df7ccc8 | |||
| 79e5097590 | |||
| 594057c4db | |||
| 773b939a5c | |||
| 8c47082c7f | |||
| 9b22987397 | |||
| 86e599a102 | |||
| 420762a463 | |||
| 5584a82d8f | |||
| 6eac642784 | |||
| ffc96efd98 | |||
| 1960151f77 | |||
| a2af50e436 | |||
| 7ebe48204a | |||
| 6ec6cd4621 | |||
| e6cb835829 | |||
| 6fd438809f | |||
| 4b9f375646 | |||
| 8ef48942a3 | |||
| 1b9d6e7d8a | |||
| a7cb237fb6 | |||
| e62dfbcc7a | |||
| a2ebbe83cb | |||
| de17d398ff | |||
| dc777a04f6 | |||
| 9c028c5e66 | |||
| 211d369509 | |||
| 3301b35067 | |||
| 41d00036e4 | |||
| bf5e2e1d25 | |||
| c5709c148b | |||
| d4bd8b0d1a | |||
| 3b4858f5b1 | |||
| 2610fc8f07 | |||
| 90e2460716 | |||
| 29f0a82f0f | |||
| 6208f642be |
@ -14,4 +14,29 @@ public class ActionController(IMediator mediator) : ControllerBase
|
|||||||
await mediator.InvokeBatchRecAction(profileId);
|
await mediator.InvokeBatchRecAction(profileId);
|
||||||
return Accepted();
|
return Accepted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IActionResult> CreateAction([FromBody] CreateRecActionCommand command)
|
||||||
|
{
|
||||||
|
await mediator.Send(command);
|
||||||
|
|
||||||
|
return CreatedAtAction(nameof(CreateAction), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("fake")]
|
||||||
|
public async Task<IActionResult> CreateFakeAction(
|
||||||
|
string? endpointUri = null,
|
||||||
|
string type = "GET",
|
||||||
|
string bodyQuery = "SELECT NULL AS REQUEST_BODY;")
|
||||||
|
{
|
||||||
|
await mediator.Send(new CreateRecActionCommand()
|
||||||
|
{
|
||||||
|
ProfileId = 2,
|
||||||
|
EndpointUri = endpointUri,
|
||||||
|
Type = type,
|
||||||
|
BodyQuery = bodyQuery
|
||||||
|
});
|
||||||
|
|
||||||
|
return CreatedAtAction(nameof(CreateFakeAction), null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -9,5 +9,6 @@
|
|||||||
"MediatRLicense": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ikx1Y2t5UGVubnlTb2Z0d2FyZUxpY2Vuc2VLZXkvYmJiMTNhY2I1OTkwNGQ4OWI0Y2IxYzg1ZjA4OGNjZjkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2x1Y2t5cGVubnlzb2Z0d2FyZS5jb20iLCJhdWQiOiJMdWNreVBlbm55U29mdHdhcmUiLCJleHAiOiIxNzg0ODUxMjAwIiwiaWF0IjoiMTc1MzM2MjQ5MSIsImFjY291bnRfaWQiOiIwMTk4M2M1OWU0YjM3MjhlYmZkMzEwM2MyYTQ4NmU4NSIsImN1c3RvbWVyX2lkIjoiY3RtXzAxazB5NmV3MmQ4YTk4Mzg3aDJnbTRuOWswIiwic3ViX2lkIjoiLSIsImVkaXRpb24iOiIwIiwidHlwZSI6IjIifQ.ZqsFG7kv_-xGfxS6ACk3i0iuNiVUXX2AvPI8iAcZ6-z2170lGv__aO32tWpQccD9LCv5931lBNLWSblKS0MT3gOt-5he2TEftwiSQGFwoIBgtOHWsNRMinUrg2trceSp3IhyS3UaMwnxZDrCvx4-0O-kpOzVpizeHUAZNr5U7oSCWO34bpKdae6grtM5e3f93Z1vs7BW_iPgItd-aLvPwApbaG9VhmBTKlQ7b4Jh64y7UXJ9mKP7Qb_Oa97oEg0oY5DPHOWTZWeE1EzORgVr2qkK2DELSHuZ_EIUhODojkClPNAKtvEl_qEjpq0HZCIvGwfCCRlKlSkQqIeZdFkiXg",
|
"MediatRLicense": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ikx1Y2t5UGVubnlTb2Z0d2FyZUxpY2Vuc2VLZXkvYmJiMTNhY2I1OTkwNGQ4OWI0Y2IxYzg1ZjA4OGNjZjkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2x1Y2t5cGVubnlzb2Z0d2FyZS5jb20iLCJhdWQiOiJMdWNreVBlbm55U29mdHdhcmUiLCJleHAiOiIxNzg0ODUxMjAwIiwiaWF0IjoiMTc1MzM2MjQ5MSIsImFjY291bnRfaWQiOiIwMTk4M2M1OWU0YjM3MjhlYmZkMzEwM2MyYTQ4NmU4NSIsImN1c3RvbWVyX2lkIjoiY3RtXzAxazB5NmV3MmQ4YTk4Mzg3aDJnbTRuOWswIiwic3ViX2lkIjoiLSIsImVkaXRpb24iOiIwIiwidHlwZSI6IjIifQ.ZqsFG7kv_-xGfxS6ACk3i0iuNiVUXX2AvPI8iAcZ6-z2170lGv__aO32tWpQccD9LCv5931lBNLWSblKS0MT3gOt-5he2TEftwiSQGFwoIBgtOHWsNRMinUrg2trceSp3IhyS3UaMwnxZDrCvx4-0O-kpOzVpizeHUAZNr5U7oSCWO34bpKdae6grtM5e3f93Z1vs7BW_iPgItd-aLvPwApbaG9VhmBTKlQ7b4Jh64y7UXJ9mKP7Qb_Oa97oEg0oY5DPHOWTZWeE1EzORgVr2qkK2DELSHuZ_EIUhODojkClPNAKtvEl_qEjpq0HZCIvGwfCCRlKlSkQqIeZdFkiXg",
|
||||||
"RecAction": {
|
"RecAction": {
|
||||||
"MaxConcurrentInvocations": 5
|
"MaxConcurrentInvocations": 5
|
||||||
}
|
},
|
||||||
|
"AddedWho": "ReC.API"
|
||||||
}
|
}
|
||||||
@ -13,14 +13,9 @@ public class BodyQueryBehavior<TRecAction>(IRecDbContext dbContext) : IPipelineB
|
|||||||
if (action.BodyQuery is null)
|
if (action.BodyQuery is null)
|
||||||
return await next(cancel);
|
return await next(cancel);
|
||||||
|
|
||||||
var result = await dbContext.BodyQueryResults.FromSqlRaw(action.BodyQuery).FirstOrDefaultAsync(cancel);
|
var result = await dbContext.BodyQueryResults.FromSqlRaw(action.BodyQuery).SingleOrDefaultAsync(cancel);
|
||||||
|
|
||||||
if (result?.RawBody is null)
|
action.Body = result?.RawBody;
|
||||||
throw new InvalidOperationException(
|
|
||||||
$"Body query did not return a result or returned a null REQUEST_BODY. " +
|
|
||||||
$"ProfileId: {action.ProfileId}, ActionId: {action.ActionId}.");
|
|
||||||
|
|
||||||
action.Body = result.RawBody;
|
|
||||||
|
|
||||||
return await next(cancel);
|
return await next(cancel);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,13 +15,11 @@ public class HeaderQueryBehavior<TRecAction>(IRecDbContext dbContext, ILogger<He
|
|||||||
if (action.HeaderQuery is null)
|
if (action.HeaderQuery is null)
|
||||||
return await next(cancel);
|
return await next(cancel);
|
||||||
|
|
||||||
var result = await dbContext.HeaderQueryResults.FromSqlRaw(action.HeaderQuery).FirstOrDefaultAsync(cancel);
|
var result = await dbContext.HeaderQueryResults.FromSqlRaw(action.HeaderQuery).SingleOrDefaultAsync(cancel);
|
||||||
|
|
||||||
if(result?.RawHeader is null)
|
if (result?.RawHeader is null)
|
||||||
{
|
{
|
||||||
logger?.LogWarning("Header query did not return a result or returned a null REQUEST_HEADER. Profile ID: {ProfileId}, Action ID: {ActionId}", action.ProfileId, action.ActionId);
|
logger?.LogWarning("Header query did not return a result or returned a null REQUEST_HEADER. Profile ID: {ProfileId}, Action ID: {Id}", action.ProfileId, action.Id);
|
||||||
|
|
||||||
action.IsReturnedNoData.HeaderQuery = true;
|
|
||||||
|
|
||||||
return await next(cancel);
|
return await next(cancel);
|
||||||
}
|
}
|
||||||
@ -31,10 +29,8 @@ public class HeaderQueryBehavior<TRecAction>(IRecDbContext dbContext, ILogger<He
|
|||||||
if(headerDict is null)
|
if(headerDict is null)
|
||||||
{
|
{
|
||||||
logger?.LogWarning(
|
logger?.LogWarning(
|
||||||
"Header JSON deserialization returned null. RawHeader: {RawHeader}, ProfileId: {ProfileId}, ActionId: {ActionId}",
|
"Header JSON deserialization returned null. RawHeader: {RawHeader}, ProfileId: {ProfileId}, Id: {Id}",
|
||||||
result.RawHeader, action.ProfileId, action.ActionId);
|
result.RawHeader, action.ProfileId, action.Id);
|
||||||
|
|
||||||
action.IsReturnedNoData.HeaderQuery = true;
|
|
||||||
|
|
||||||
return await next(cancel);
|
return await next(cancel);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,6 @@ public class DtoMappingProfile : Profile
|
|||||||
{
|
{
|
||||||
public DtoMappingProfile()
|
public DtoMappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<RecAction, RecActionDto>();
|
CreateMap<RecActionView, RecActionDto>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
public record RecActionDto
|
public record RecActionDto
|
||||||
{
|
{
|
||||||
public long? ActionId { get; init; }
|
public required long Id { get; init; }
|
||||||
|
|
||||||
public long? ProfileId { get; init; }
|
public long? ProfileId { get; init; }
|
||||||
|
|
||||||
@ -60,8 +60,6 @@ public record RecActionDto
|
|||||||
|
|
||||||
public string? Body { get; set; }
|
public string? Body { get; set; }
|
||||||
|
|
||||||
public (bool BodyQuery, bool HeaderQuery) IsReturnedNoData = (false, false);
|
|
||||||
|
|
||||||
public string? PostprocessingQuery { get; init; }
|
public string? PostprocessingQuery { get; init; }
|
||||||
|
|
||||||
public UriBuilder ToEndpointUriBuilder()
|
public UriBuilder ToEndpointUriBuilder()
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
namespace ReC.Application.Common.Exceptions;
|
||||||
|
|
||||||
|
public class DataIntegrityException : Exception
|
||||||
|
{
|
||||||
|
public DataIntegrityException() { }
|
||||||
|
|
||||||
|
public DataIntegrityException(string message) : base(message) { }
|
||||||
|
}
|
||||||
@ -7,7 +7,7 @@ public interface IRecDbContext
|
|||||||
{
|
{
|
||||||
public DbSet<EndpointParam> EndpointParams { get; }
|
public DbSet<EndpointParam> EndpointParams { get; }
|
||||||
|
|
||||||
public DbSet<RecAction> Actions { get; }
|
public DbSet<RecActionView> Actions { get; }
|
||||||
|
|
||||||
public DbSet<OutRes> OutRes { get; }
|
public DbSet<OutRes> OutRes { get; }
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,25 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using ReC.Domain.Entities;
|
||||||
|
|
||||||
|
namespace ReC.Application.Endpoints.Commands;
|
||||||
|
|
||||||
|
public class ObtainEndpointCommand : IRequest<Endpoint>
|
||||||
|
{
|
||||||
|
public string Uri { get; init; } = null!;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ObtainEndpointCommandHandler(IRepository<Endpoint> repo) : IRequestHandler<ObtainEndpointCommand, Endpoint>
|
||||||
|
{
|
||||||
|
public async Task<Endpoint> Handle(ObtainEndpointCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var endpoint = await repo.Where(e => e.Uri == request.Uri).FirstOrDefaultAsync(cancel);
|
||||||
|
|
||||||
|
if (endpoint is not null)
|
||||||
|
return endpoint;
|
||||||
|
|
||||||
|
endpoint = await repo.CreateAsync(request, cancel);
|
||||||
|
return endpoint;
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/ReC.Application/Endpoints/MappingProfile.cs
Normal file
12
src/ReC.Application/Endpoints/MappingProfile.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using ReC.Application.Endpoints.Commands;
|
||||||
|
using ReC.Domain.Entities;
|
||||||
|
|
||||||
|
namespace ReC.Application.Endpoints;
|
||||||
|
|
||||||
|
public class MappingProfile : AutoMapper.Profile
|
||||||
|
{
|
||||||
|
public MappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<ObtainEndpointCommand, Endpoint>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace ReC.Application.OutResults.Commands;
|
||||||
|
|
||||||
|
public class CreateOutResCommand : IRequest
|
||||||
|
{
|
||||||
|
public required long ActionId { get; set; }
|
||||||
|
|
||||||
|
public string? Header { get; set; }
|
||||||
|
|
||||||
|
public string? Body { get; set; }
|
||||||
|
|
||||||
|
public string? AddedWho { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CreateOutResCommandHandler(IRepository<CreateOutResCommand> repo) : IRequestHandler<CreateOutResCommand>
|
||||||
|
{
|
||||||
|
public Task Handle(CreateOutResCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
return repo.CreateAsync(request, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/ReC.Application/OutResults/MappingProfiles.cs
Normal file
13
src/ReC.Application/OutResults/MappingProfiles.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using ReC.Application.OutResults.Commands;
|
||||||
|
using ReC.Domain.Entities;
|
||||||
|
|
||||||
|
namespace ReC.Application.OutResults;
|
||||||
|
|
||||||
|
public class MappingProfiles : Profile
|
||||||
|
{
|
||||||
|
public MappingProfiles()
|
||||||
|
{
|
||||||
|
CreateMap<CreateOutResCommand, OutRes>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
using DigitalData.Core.Exceptions;
|
||||||
|
using MediatR;
|
||||||
|
using ReC.Application.Endpoints.Commands;
|
||||||
|
|
||||||
|
namespace ReC.Application.RecActions.Commands;
|
||||||
|
|
||||||
|
public record CreateRecActionCommand : IRequest
|
||||||
|
{
|
||||||
|
public long ProfileId { get; init; }
|
||||||
|
|
||||||
|
public bool Active { get; init; } = true;
|
||||||
|
|
||||||
|
public long? EndpointId { get; set; }
|
||||||
|
|
||||||
|
public string? EndpointUri { get; init; }
|
||||||
|
|
||||||
|
public string Type { get; init; } = null!;
|
||||||
|
|
||||||
|
public string? HeaderQuery { get; init; }
|
||||||
|
|
||||||
|
public string BodyQuery { get; init; } = null!;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CreateRecActionCommandHandler(ISender sender) : IRequestHandler<CreateRecActionCommand>
|
||||||
|
{
|
||||||
|
public async Task Handle(CreateRecActionCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
if(request.EndpointId is null)
|
||||||
|
if(request.EndpointUri is string endpointUri)
|
||||||
|
{
|
||||||
|
var endpoint = await sender.Send(new ObtainEndpointCommand { Uri = endpointUri }, cancel);
|
||||||
|
request.EndpointId = endpoint.Id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw new BadRequestException("Either EndpointId or EndpointUri must be provided.");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using MediatR;
|
||||||
|
using ReC.Domain.Entities;
|
||||||
|
|
||||||
|
namespace ReC.Application.RecActions.Commands;
|
||||||
|
|
||||||
|
public class DeleteRecActionsCommand : IRequest
|
||||||
|
{
|
||||||
|
public long ProfileId { get; init; } = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteRecActionsCommandHandler(IRepository<RecAction> repo) : IRequestHandler<DeleteRecActionsCommand>
|
||||||
|
{
|
||||||
|
public Task Handle(DeleteRecActionsCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
return repo.DeleteAsync(act => act.ProfileId == request.ProfileId, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -33,9 +33,9 @@ public class InvokeRecActionsCommandHandler(ISender sender, IHttpClientFactory c
|
|||||||
{
|
{
|
||||||
logger?.LogError(
|
logger?.LogError(
|
||||||
ex,
|
ex,
|
||||||
"Error invoking Rec action. ProfileId: {ProfileId}, ActionId: {ActionId}",
|
"Error invoking Rec action. ProfileId: {ProfileId}, Id: {Id}",
|
||||||
action.ProfileId,
|
action.ProfileId,
|
||||||
action.ActionId
|
action.Id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@ -1,68 +1,65 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Configuration;
|
||||||
using ReC.Application.Common;
|
using ReC.Application.Common;
|
||||||
using ReC.Application.Common.Dto;
|
using ReC.Application.Common.Dto;
|
||||||
|
using ReC.Application.Common.Exceptions;
|
||||||
|
using ReC.Application.OutResults.Commands;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace ReC.Application.RecActions.Commands;
|
namespace ReC.Application.RecActions.Commands;
|
||||||
|
|
||||||
public record InvokeRecActionCommand : RecActionDto, IRequest
|
public record InvokeRecActionCommand : IRequest
|
||||||
{
|
{
|
||||||
public InvokeRecActionCommand(RecActionDto root) : base(root) { }
|
public RecActionDto Action { get; set; } = null!;
|
||||||
|
|
||||||
public InvokeRecActionCommand() { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class InvokeRecActionCommandExtensions
|
public static class InvokeRecActionCommandExtensions
|
||||||
{
|
{
|
||||||
public static InvokeRecActionCommand ToInvokeCommand(this RecActionDto dto) => new(dto);
|
public static InvokeRecActionCommand ToInvokeCommand(this RecActionDto dto) => new() { Action = dto };
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InvokeRecActionCommandHandler(
|
public class InvokeRecActionCommandHandler(
|
||||||
|
ISender sender,
|
||||||
IHttpClientFactory clientFactory,
|
IHttpClientFactory clientFactory,
|
||||||
ILogger<InvokeRecActionsCommandHandler>? logger = null
|
IConfiguration? config = null
|
||||||
) : IRequestHandler<InvokeRecActionCommand>
|
) : IRequestHandler<InvokeRecActionCommand>
|
||||||
{
|
{
|
||||||
public async Task Handle(InvokeRecActionCommand request, CancellationToken cancel)
|
public async Task Handle(InvokeRecActionCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
|
var action = request.Action;
|
||||||
using var http = clientFactory.CreateClient();
|
using var http = clientFactory.CreateClient();
|
||||||
|
|
||||||
if (request.RestType is null)
|
if (action.RestType is null)
|
||||||
{
|
throw new DataIntegrityException(
|
||||||
logger?.LogWarning(
|
$"Rec action could not be invoked because the RestType value is null. " +
|
||||||
"Rec action could not be invoked because the RestType value is null. ProfileId: {ProfileId}, ActionId: {ActionId}",
|
$"ProfileId: {action.ProfileId}, " +
|
||||||
request.ProfileId,
|
$"Id: {action.Id}"
|
||||||
request.ActionId
|
);
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using var httpReq = request.RestType
|
using var httpReq = action.RestType
|
||||||
.ToHttpMethod()
|
.ToHttpMethod()
|
||||||
.ToHttpRequestMessage(request.EndpointUri);
|
.ToHttpRequestMessage(action.EndpointUri);
|
||||||
|
|
||||||
if(request.Body is not null)
|
if(action.Body is not null)
|
||||||
{
|
{
|
||||||
using var reqBody = new StringContent(request.Body);
|
using var reqBody = new StringContent(action.Body);
|
||||||
httpReq.Content = reqBody;
|
httpReq.Content = reqBody;
|
||||||
}
|
}
|
||||||
else if(request.BodyQuery is not null && !request.IsReturnedNoData.BodyQuery)
|
|
||||||
{
|
|
||||||
logger?.LogWarning(
|
|
||||||
"Although BodyQuery returns null, the IsReturnedNoData variable has not been set to TRUE. " +
|
|
||||||
"This indicates that BodyQueryBehavior has not been executed or that the relevant control step has been skipped. " +
|
|
||||||
"The relevant behavior must be verified to ensure that the process does not produce unexpected conditions. " +
|
|
||||||
"ProfileId: {ProfileId}, ActionId: {ActionId}",
|
|
||||||
request.ProfileId,
|
|
||||||
request.ActionId
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.Headers is not null)
|
if (action.Headers is not null)
|
||||||
foreach (var header in request.Headers)
|
foreach (var header in action.Headers)
|
||||||
httpReq.Headers.Add(header.Key, header.Value);
|
httpReq.Headers.Add(header.Key, header.Value);
|
||||||
|
|
||||||
using var response = await http.SendAsync(httpReq, cancel);
|
using var response = await http.SendAsync(httpReq, cancel);
|
||||||
var body = await response.Content.ReadAsStringAsync(cancel);
|
var resBody = await response.Content.ReadAsStringAsync(cancel);
|
||||||
var headers = response.Headers.ToDictionary();
|
var resHeaders = response.Headers.ToDictionary();
|
||||||
|
|
||||||
|
await sender.Send(new CreateOutResCommand
|
||||||
|
{
|
||||||
|
ActionId = action.Id,
|
||||||
|
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
|
||||||
|
Body = resBody,
|
||||||
|
AddedWho = config?["AddedWho"]
|
||||||
|
}, cancel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12
src/ReC.Application/RecActions/MappingProfile.cs
Normal file
12
src/ReC.Application/RecActions/MappingProfile.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using ReC.Application.RecActions.Commands;
|
||||||
|
using ReC.Domain.Entities;
|
||||||
|
|
||||||
|
namespace ReC.Application.RecActions;
|
||||||
|
|
||||||
|
public class MappingProfile : AutoMapper.Profile
|
||||||
|
{
|
||||||
|
public MappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<CreateRecActionCommand, RecAction>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -17,7 +17,7 @@ public record ReadRecActionQueryBase
|
|||||||
|
|
||||||
public record ReadRecActionQuery(ReadRecActionQueryBase Root) : ReadRecActionQueryBase(Root), IRequest<IEnumerable<RecActionDto>>;
|
public record ReadRecActionQuery(ReadRecActionQueryBase Root) : ReadRecActionQueryBase(Root), IRequest<IEnumerable<RecActionDto>>;
|
||||||
|
|
||||||
public class ReadRecActionQueryHandler(IRepository<RecAction> repo, IMapper mapper) : IRequestHandler<ReadRecActionQuery, IEnumerable<RecActionDto>>
|
public class ReadRecActionQueryHandler(IRepository<RecActionView> repo, IMapper mapper) : IRequestHandler<ReadRecActionQuery, IEnumerable<RecActionDto>>
|
||||||
{
|
{
|
||||||
public async Task<IEnumerable<RecActionDto>> Handle(ReadRecActionQuery request, CancellationToken cancel)
|
public async Task<IEnumerable<RecActionDto>> Handle(ReadRecActionQuery request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
|
|||||||
53
src/ReC.Domain/Entities/Connection.cs
Normal file
53
src/ReC.Domain/Entities/Connection.cs
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
|
[Table("TBDD_CONNECTION")]
|
||||||
|
public class Connection
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
[Column("GUID")]
|
||||||
|
public short? Id { get; set; }
|
||||||
|
|
||||||
|
[Column("BEZEICHNUNG")]
|
||||||
|
public string? Bezeichnung { get; set; }
|
||||||
|
|
||||||
|
[Column("SQL_PROVIDER")]
|
||||||
|
public string? SqlProvider { get; set; }
|
||||||
|
|
||||||
|
[Column("SERVER")]
|
||||||
|
public string? Server { get; set; }
|
||||||
|
|
||||||
|
[Column("DATENBANK")]
|
||||||
|
public string? Datenbank { get; set; }
|
||||||
|
|
||||||
|
[Column("USERNAME")]
|
||||||
|
public string? Username { get; set; }
|
||||||
|
|
||||||
|
[Column("PASSWORD")]
|
||||||
|
public string? Password { get; set; }
|
||||||
|
|
||||||
|
[Column("BEMERKUNG")]
|
||||||
|
public string? Bemerkung { get; set; }
|
||||||
|
|
||||||
|
[Column("AKTIV")]
|
||||||
|
public bool? Aktiv { get; set; }
|
||||||
|
|
||||||
|
[Column("ERSTELLTWER")]
|
||||||
|
public string? ErstelltWer { get; set; }
|
||||||
|
|
||||||
|
[Column("ERSTELLTWANN")]
|
||||||
|
public DateTime? ErstelltWann { get; set; }
|
||||||
|
|
||||||
|
[Column("GEANDERTWER")]
|
||||||
|
public string? GeandertWer { get; set; }
|
||||||
|
|
||||||
|
[Column("GEAENDERTWANN")]
|
||||||
|
public DateTime? GeaendertWann { get; set; }
|
||||||
|
|
||||||
|
[Column("SYS_CONNECTION")]
|
||||||
|
public bool? SysConnection { get; set; }
|
||||||
|
}
|
||||||
35
src/ReC.Domain/Entities/Endpoint.cs
Normal file
35
src/ReC.Domain/Entities/Endpoint.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
|
[Table("TBREC_CFG_ENDPOINT")]
|
||||||
|
public class Endpoint
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[Column("GUID")]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
[Column("ACTIVE")]
|
||||||
|
public bool? Active { get; set; }
|
||||||
|
|
||||||
|
[Column("DESCRIPTION")]
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
[Column("URI")]
|
||||||
|
public string? Uri { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHO")]
|
||||||
|
public string? AddedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHEN")]
|
||||||
|
public DateTime? AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHO")]
|
||||||
|
public string? ChangedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN")]
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
}
|
||||||
59
src/ReC.Domain/Entities/EndpointAuth.cs
Normal file
59
src/ReC.Domain/Entities/EndpointAuth.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
|
[Table("TBREC_CFG_ENDPOINT_AUTH")]
|
||||||
|
public class EndpointAuth
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[Column("GUID")]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
[Column("ACTIVE")]
|
||||||
|
public bool? Active { get; set; }
|
||||||
|
|
||||||
|
[Column("DESCRIPTION")]
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
[Column("TYPE")]
|
||||||
|
public string? Type { get; set; }
|
||||||
|
|
||||||
|
[Column("API_KEY")]
|
||||||
|
public string? ApiKey { get; set; }
|
||||||
|
|
||||||
|
[Column("API_VALUE")]
|
||||||
|
public string? ApiValue { get; set; }
|
||||||
|
|
||||||
|
[Column("API_KEY_ADD_TO")]
|
||||||
|
public string? ApiKeyAddTo { get; set; }
|
||||||
|
|
||||||
|
[Column("TOKEN")]
|
||||||
|
public string? Token { get; set; }
|
||||||
|
|
||||||
|
[Column("USERNAME")]
|
||||||
|
public string? Username { get; set; }
|
||||||
|
|
||||||
|
[Column("PASSWORD")]
|
||||||
|
public string? Password { get; set; }
|
||||||
|
|
||||||
|
[Column("DOMAIN")]
|
||||||
|
public string? Domain { get; set; }
|
||||||
|
|
||||||
|
[Column("WORKSTATION")]
|
||||||
|
public string? Workstation { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHO")]
|
||||||
|
public string? AddedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHEN")]
|
||||||
|
public DateTime? AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHO")]
|
||||||
|
public string? ChangedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN")]
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
}
|
||||||
@ -13,7 +13,7 @@ public class EndpointParam
|
|||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[Column("GUID")]
|
[Column("GUID")]
|
||||||
public long? Guid { get; set; }
|
public long? Id { get; set; }
|
||||||
|
|
||||||
[Column("ACTIVE")]
|
[Column("ACTIVE")]
|
||||||
public bool? Active { get; set; }
|
public bool? Active { get; set; }
|
||||||
|
|||||||
@ -15,10 +15,10 @@ public class OutRes
|
|||||||
public long? ActionId { get; set; }
|
public long? ActionId { get; set; }
|
||||||
|
|
||||||
[Column("RESULT_HEADER")]
|
[Column("RESULT_HEADER")]
|
||||||
public string? ResultHeader { get; set; }
|
public string? Header { get; set; }
|
||||||
|
|
||||||
[Column("RESULT_BODY")]
|
[Column("RESULT_BODY")]
|
||||||
public string? ResultBody { get; set; }
|
public string? Body { get; set; }
|
||||||
|
|
||||||
[Column("ADDED_WHO")]
|
[Column("ADDED_WHO")]
|
||||||
public string? AddedWho { get; set; }
|
public string? AddedWho { get; set; }
|
||||||
|
|||||||
47
src/ReC.Domain/Entities/Profile.cs
Normal file
47
src/ReC.Domain/Entities/Profile.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
|
[Table("TBREC_CFG_PROFILE", Schema = "dbo")]
|
||||||
|
public class Profile
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
[Column("GUID")]
|
||||||
|
public short? Id { get; set; }
|
||||||
|
|
||||||
|
[Column("ACTIVE")]
|
||||||
|
public bool? Active { get; set; }
|
||||||
|
|
||||||
|
[Column("TYPE")]
|
||||||
|
public string? Type { get; set; }
|
||||||
|
|
||||||
|
[Column("MANDANTOR")]
|
||||||
|
public string? Mandantor { get; set; }
|
||||||
|
|
||||||
|
[Column("PROFILE_NAME")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
[Column("DESCRIPTION")]
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
[Column("LOG_LEVEL")]
|
||||||
|
public string? LogLevel { get; set; }
|
||||||
|
|
||||||
|
[Column("LANGUAGE")]
|
||||||
|
public string? Language { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHO")]
|
||||||
|
public string? AddedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHEN")]
|
||||||
|
public DateTime? AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHO")]
|
||||||
|
public string? ChangedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN")]
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
}
|
||||||
@ -3,79 +3,36 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
|
|
||||||
namespace ReC.Domain.Entities;
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
/// <summary>
|
[Table("TBREC_CFG_ACTION")]
|
||||||
/// Represents the VWREC_ACTION view from the database.
|
|
||||||
///
|
|
||||||
/// All properties are defined as nullable to provide flexibility in case the underlying view
|
|
||||||
/// changes in production (e.g., columns added, removed, or modified). This approach prevents
|
|
||||||
/// runtime mapping errors and ensures the application can handle schema changes without
|
|
||||||
/// requiring immediate code updates.
|
|
||||||
/// </summary>
|
|
||||||
[Table("VWREC_ACTION", Schema = "dbo")]
|
|
||||||
public class RecAction
|
public class RecAction
|
||||||
{
|
{
|
||||||
[Column("ACTION_ID")]
|
[Key]
|
||||||
public long? ActionId { get; set; }
|
[Column("GUID")]
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
[Column("PROFILE_ID")]
|
[Column("PROFILE_ID")]
|
||||||
public long? ProfileId { get; set; }
|
public long? ProfileId { get; set; }
|
||||||
|
|
||||||
[Column("PROFILE_NAME")]
|
[ForeignKey("ProfileId")]
|
||||||
[MaxLength(100)]
|
public Profile? Profile { get; set; }
|
||||||
public string? ProfileName { get; set; }
|
|
||||||
|
|
||||||
[Column("PROFILE_TYPE")]
|
[Column("ACTIVE")]
|
||||||
[MaxLength(20)]
|
public bool? Active { get; set; }
|
||||||
public string? ProfileType { get; set; }
|
|
||||||
|
|
||||||
[Column("PROFILE_SEQUENCE")]
|
[Column("SEQUENCE")]
|
||||||
public byte? ProfileSequence { get; set; }
|
public byte? Sequence { get; set; }
|
||||||
|
|
||||||
[Column("ENDPOINT_ID")]
|
[Column("ENDPOINT_ID")]
|
||||||
public long? EndpointId { get; set; }
|
public long? EndpointId { get; set; }
|
||||||
|
|
||||||
[Column("ENDPOINT_URI")]
|
[ForeignKey("EndpointId")]
|
||||||
[MaxLength(4000)]
|
public Endpoint? Endpoint { get; set; }
|
||||||
public string? EndpointUri { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_ID")]
|
[Column("ENDPOINT_AUTH_ID")]
|
||||||
public long? EndpointAuthId { get; set; }
|
public long? EndpointAuthId { get; set; }
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_TYPE")]
|
[ForeignKey("EndpointAuthId")]
|
||||||
[MaxLength(50)]
|
public EndpointAuth? EndpointAuth { get; set; }
|
||||||
public string? EndpointAuthType { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_API_KEY")]
|
|
||||||
[MaxLength(300)]
|
|
||||||
public string? EndpointAuthApiKey { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_API_VALUE")]
|
|
||||||
[MaxLength(300)]
|
|
||||||
public string? EndpointAuthApiValue { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_API_KEY_ADD_TO")]
|
|
||||||
[MaxLength(20)]
|
|
||||||
public string? EndpointAuthApiKeyAddTo { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_TOKEN")]
|
|
||||||
[MaxLength(300)]
|
|
||||||
public string? EndpointAuthToken { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_USERNAME")]
|
|
||||||
[MaxLength(200)]
|
|
||||||
public string? EndpointAuthUsername { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_PASSWORD")]
|
|
||||||
[MaxLength(200)]
|
|
||||||
public string? EndpointAuthPassword { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_DOMAIN")]
|
|
||||||
[MaxLength(100)]
|
|
||||||
public string? EndpointAuthDomain { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_AUTH_WORKSTATION")]
|
|
||||||
[MaxLength(100)]
|
|
||||||
public string? EndpointAuthWorkstation { get; set; }
|
|
||||||
|
|
||||||
[Column("ENDPOINT_PARAMS_ID")]
|
[Column("ENDPOINT_PARAMS_ID")]
|
||||||
public short? EndpointParamsId { get; set; }
|
public short? EndpointParamsId { get; set; }
|
||||||
@ -83,25 +40,11 @@ public class RecAction
|
|||||||
[Column("SQL_CONNECTION_ID")]
|
[Column("SQL_CONNECTION_ID")]
|
||||||
public short? SqlConnectionId { get; set; }
|
public short? SqlConnectionId { get; set; }
|
||||||
|
|
||||||
[Column("SQL_CONNECTION_SERVER")]
|
[ForeignKey("SqlConnectionId")]
|
||||||
[MaxLength(150)]
|
public Connection? SqlConnection { get; set; }
|
||||||
public string? SqlConnectionServer { get; set; }
|
|
||||||
|
|
||||||
[Column("SQL_CONNECTION_DB")]
|
[Column("TYPE")]
|
||||||
[MaxLength(100)]
|
public string? Type { get; set; }
|
||||||
public string? SqlConnectionDb { get; set; }
|
|
||||||
|
|
||||||
[Column("SQL_CONNECTION_USERNAME")]
|
|
||||||
[MaxLength(100)]
|
|
||||||
public string? SqlConnectionUsername { get; set; }
|
|
||||||
|
|
||||||
[Column("SQL_CONNECTION_PASSWORD")]
|
|
||||||
[MaxLength(100)]
|
|
||||||
public string? SqlConnectionPassword { get; set; }
|
|
||||||
|
|
||||||
[Column("REST_TYPE")]
|
|
||||||
[MaxLength(20)]
|
|
||||||
public string? RestType { get; set; }
|
|
||||||
|
|
||||||
[Column("PREPROCESSING_QUERY")]
|
[Column("PREPROCESSING_QUERY")]
|
||||||
public string? PreprocessingQuery { get; set; }
|
public string? PreprocessingQuery { get; set; }
|
||||||
@ -114,4 +57,16 @@ public class RecAction
|
|||||||
|
|
||||||
[Column("POSTPROCESSING_QUERY")]
|
[Column("POSTPROCESSING_QUERY")]
|
||||||
public string? PostprocessingQuery { get; set; }
|
public string? PostprocessingQuery { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHO")]
|
||||||
|
public string? AddedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHEN")]
|
||||||
|
public DateTime? AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHO")]
|
||||||
|
public string? ChangedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN")]
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
}
|
}
|
||||||
117
src/ReC.Domain/Entities/RecActionView.cs
Normal file
117
src/ReC.Domain/Entities/RecActionView.cs
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the VWREC_ACTION view from the database.
|
||||||
|
///
|
||||||
|
/// All properties are defined as nullable to provide flexibility in case the underlying view
|
||||||
|
/// changes in production (e.g., columns added, removed, or modified). This approach prevents
|
||||||
|
/// runtime mapping errors and ensures the application can handle schema changes without
|
||||||
|
/// requiring immediate code updates.
|
||||||
|
/// </summary>
|
||||||
|
[Table("VWREC_ACTION", Schema = "dbo")]
|
||||||
|
public class RecActionView
|
||||||
|
{
|
||||||
|
[Column("ACTION_ID")]
|
||||||
|
public required long Id { get; set; }
|
||||||
|
|
||||||
|
[Column("PROFILE_ID")]
|
||||||
|
public long? ProfileId { get; set; }
|
||||||
|
|
||||||
|
[Column("PROFILE_NAME")]
|
||||||
|
[MaxLength(100)]
|
||||||
|
public string? ProfileName { get; set; }
|
||||||
|
|
||||||
|
[Column("PROFILE_TYPE")]
|
||||||
|
[MaxLength(20)]
|
||||||
|
public string? ProfileType { get; set; }
|
||||||
|
|
||||||
|
[Column("PROFILE_SEQUENCE")]
|
||||||
|
public byte? ProfileSequence { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_ID")]
|
||||||
|
public long? EndpointId { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_URI")]
|
||||||
|
[MaxLength(4000)]
|
||||||
|
public string? EndpointUri { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_ID")]
|
||||||
|
public long? EndpointAuthId { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_TYPE")]
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string? EndpointAuthType { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_API_KEY")]
|
||||||
|
[MaxLength(300)]
|
||||||
|
public string? EndpointAuthApiKey { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_API_VALUE")]
|
||||||
|
[MaxLength(300)]
|
||||||
|
public string? EndpointAuthApiValue { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_API_KEY_ADD_TO")]
|
||||||
|
[MaxLength(20)]
|
||||||
|
public string? EndpointAuthApiKeyAddTo { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_TOKEN")]
|
||||||
|
[MaxLength(300)]
|
||||||
|
public string? EndpointAuthToken { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_USERNAME")]
|
||||||
|
[MaxLength(200)]
|
||||||
|
public string? EndpointAuthUsername { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_PASSWORD")]
|
||||||
|
[MaxLength(200)]
|
||||||
|
public string? EndpointAuthPassword { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_DOMAIN")]
|
||||||
|
[MaxLength(100)]
|
||||||
|
public string? EndpointAuthDomain { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_AUTH_WORKSTATION")]
|
||||||
|
[MaxLength(100)]
|
||||||
|
public string? EndpointAuthWorkstation { get; set; }
|
||||||
|
|
||||||
|
[Column("ENDPOINT_PARAMS_ID")]
|
||||||
|
public short? EndpointParamsId { get; set; }
|
||||||
|
|
||||||
|
[Column("SQL_CONNECTION_ID")]
|
||||||
|
public short? SqlConnectionId { get; set; }
|
||||||
|
|
||||||
|
[Column("SQL_CONNECTION_SERVER")]
|
||||||
|
[MaxLength(150)]
|
||||||
|
public string? SqlConnectionServer { get; set; }
|
||||||
|
|
||||||
|
[Column("SQL_CONNECTION_DB")]
|
||||||
|
[MaxLength(100)]
|
||||||
|
public string? SqlConnectionDb { get; set; }
|
||||||
|
|
||||||
|
[Column("SQL_CONNECTION_USERNAME")]
|
||||||
|
[MaxLength(100)]
|
||||||
|
public string? SqlConnectionUsername { get; set; }
|
||||||
|
|
||||||
|
[Column("SQL_CONNECTION_PASSWORD")]
|
||||||
|
[MaxLength(100)]
|
||||||
|
public string? SqlConnectionPassword { get; set; }
|
||||||
|
|
||||||
|
[Column("REST_TYPE")]
|
||||||
|
[MaxLength(20)]
|
||||||
|
public string? RestType { get; set; }
|
||||||
|
|
||||||
|
[Column("PREPROCESSING_QUERY")]
|
||||||
|
public string? PreprocessingQuery { get; set; }
|
||||||
|
|
||||||
|
[Column("HEADER_QUERY")]
|
||||||
|
public string? HeaderQuery { get; set; }
|
||||||
|
|
||||||
|
[Column("BODY_QUERY")]
|
||||||
|
public string? BodyQuery { get; set; }
|
||||||
|
|
||||||
|
[Column("POSTPROCESSING_QUERY")]
|
||||||
|
public string? PostprocessingQuery { get; set; }
|
||||||
|
}
|
||||||
@ -21,7 +21,7 @@ public static class DependencyInjection
|
|||||||
|
|
||||||
services.AddScoped<IRecDbContext>(provider => provider.GetRequiredService<TRecDbContext>());
|
services.AddScoped<IRecDbContext>(provider => provider.GetRequiredService<TRecDbContext>());
|
||||||
|
|
||||||
services.AddDbRepository(opt => opt.RegisterFromAssembly<TRecDbContext>(typeof(RecAction).Assembly));
|
services.AddDbRepository(opt => opt.RegisterFromAssembly<TRecDbContext>(typeof(RecActionView).Assembly));
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
|||||||
{
|
{
|
||||||
public DbSet<EndpointParam> EndpointParams { get; set; }
|
public DbSet<EndpointParam> EndpointParams { get; set; }
|
||||||
|
|
||||||
public DbSet<RecAction> Actions { get; set; }
|
public DbSet<RecActionView> Actions { get; set; }
|
||||||
|
|
||||||
public DbSet<OutRes> OutRes { get; set; }
|
public DbSet<OutRes> OutRes { get; set; }
|
||||||
|
|
||||||
@ -16,11 +16,21 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
|||||||
|
|
||||||
public DbSet<BodyQueryResult> BodyQueryResults { get; set; }
|
public DbSet<BodyQueryResult> BodyQueryResults { get; set; }
|
||||||
|
|
||||||
|
public DbSet<Connection> Connections { get; set; }
|
||||||
|
|
||||||
|
public DbSet<Endpoint> Endpoints { get; set; }
|
||||||
|
|
||||||
|
public DbSet<EndpointAuth> EndpointAuths { get; set; }
|
||||||
|
|
||||||
|
public DbSet<Profile> Profiles { get; set; }
|
||||||
|
|
||||||
|
public DbSet<RecAction> RecActions { get; set; }
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
base.OnModelCreating(modelBuilder);
|
base.OnModelCreating(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity<RecAction>().HasNoKey();
|
modelBuilder.Entity<RecActionView>().HasNoKey();
|
||||||
|
|
||||||
modelBuilder.Entity<HeaderQueryResult>().HasNoKey();
|
modelBuilder.Entity<HeaderQueryResult>().HasNoKey();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user