Compare commits
6 Commits
e5295b8302
...
f0f92c5400
| Author | SHA1 | Date | |
|---|---|---|---|
| f0f92c5400 | |||
| 7e34f01f6a | |||
| f449767bf9 | |||
| f8ec6065c2 | |||
| fabfe80666 | |||
| bdb3863c07 |
@@ -71,6 +71,7 @@ public class EnvelopeController : ControllerBase
|
||||
[HttpGet("doc-result")]
|
||||
public async Task<IActionResult> GetDocResultAsync([FromQuery] ReadEnvelopeQuery query, [FromQuery] bool view = false)
|
||||
{
|
||||
query.IncludeDocResult = true;
|
||||
var envelopes = await _mediator.Send(query.Authorize(User.GetId()));
|
||||
var envelope = envelopes.FirstOrDefault();
|
||||
|
||||
|
||||
@@ -14,4 +14,10 @@ public record EnvelopeQueryBase
|
||||
/// Die universell eindeutige Kennung des Umschlags.
|
||||
/// </summary>
|
||||
public virtual string? Uuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Wenn gesetzt, wird das DocResult-Feld in der Abfrage einbezogen.
|
||||
/// Standardmäßig wird DocResult nicht geladen, um große Binärdaten zu vermeiden.
|
||||
/// </summary>
|
||||
public bool IncludeDocResult { get; set; } = false;
|
||||
}
|
||||
@@ -39,6 +39,7 @@ public class ReadSingleEnvelopeDocResultQueryHandler : IRequestHandler<ReadSingl
|
||||
/// <returns></returns>
|
||||
public async Task<byte[]> Handle(ReadSingleEnvelopeDocResultQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
request.Envelope.IncludeDocResult = true;
|
||||
var result = await _mediator.Send(request.Envelope, cancellationToken);
|
||||
return result.DocResult is byte[] docResult && docResult.Length > 0
|
||||
? docResult
|
||||
|
||||
@@ -140,7 +140,9 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
= false;
|
||||
#endif
|
||||
|
||||
#if NETFRAMEWORK
|
||||
[NotMapped]
|
||||
#endif
|
||||
[Column("DOC_RESULT")]
|
||||
public byte[]
|
||||
#if nullable
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using EnvelopeGenerator.ServiceHost.Jobs;
|
||||
using EnvelopeGenerator.ServiceHost.Jobs.FinalizeDocument;
|
||||
using EnvelopeGenerator.ServiceHost.Jobs.Infrastructure;
|
||||
using GdPicture14;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
@@ -12,11 +11,12 @@ public static class DependencyInjection
|
||||
public static IServiceCollection AddFinalizeDocumentJob(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.Configure<WorkerOptions>(configuration.GetSection(nameof(WorkerOptions)));
|
||||
services.AddSingleton<FinalizeDocumentJob>();
|
||||
services.AddScoped<FinalizeDocumentJob>();
|
||||
services.AddScoped<ActionService>();
|
||||
services.AddSingleton<TempFiles>();
|
||||
services.AddScoped<PDFBurner>();
|
||||
services.AddScoped<PDFMerger>();
|
||||
services.AddScoped<ReportCreator>();
|
||||
|
||||
//TODO: Check lifetime of services. They might be singleton or scoped.
|
||||
services.AddTransient<GdViewer>();
|
||||
|
||||
@@ -3,6 +3,7 @@ using EnvelopeGenerator.Application;
|
||||
using EnvelopeGenerator.Infrastructure;
|
||||
using EnvelopeGenerator.ServiceHost;
|
||||
using EnvelopeGenerator.ServiceHost.Extensions;
|
||||
using EnvelopeGenerator.ServiceHost.Middleware;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Globalization;
|
||||
@@ -15,12 +16,12 @@ if (builder.Configuration.GetValue<bool>("UseWindowsService"))
|
||||
builder.Host.UseWindowsService();
|
||||
}
|
||||
|
||||
if (builder.Configuration.GetValue<bool>("UseKestrelConfig"))
|
||||
if (builder.Configuration.GetValue<bool>("UseCustomKestrelEndpoints"))
|
||||
{
|
||||
builder.WebHost.ConfigureKestrel((context, serverOptions) =>
|
||||
{
|
||||
var kestrelSection = context.Configuration.GetSection("Kestrel");
|
||||
serverOptions.Configure(kestrelSection);
|
||||
var serverConfigSection = context.Configuration.GetSection("ServerConfig");
|
||||
serverOptions.Configure(serverConfigSection);
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
@@ -65,6 +66,8 @@ builder.Services.AddSwaggerGen();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseMiddleware<ExceptionHandlingMiddleware>();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
|
||||
},
|
||||
"UseWindowsService": false,
|
||||
"UseKestrelConfig": false,
|
||||
"Kestrel": {
|
||||
"UseCustomKestrelEndpoints": false,
|
||||
"ServerConfig": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://localhost:1111"
|
||||
|
||||
Reference in New Issue
Block a user