add SaveBurnedPdfBehavior to services
This commit is contained in:
parent
a2df5d7691
commit
31f5d1f340
@ -1,5 +1,6 @@
|
||||
using EnvelopeGenerator.Application.Pdf;
|
||||
using MediatR;
|
||||
using Org.BouncyCastle.Utilities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Behaviors;
|
||||
|
||||
@ -15,10 +16,10 @@ public class SaveBurnedPdfBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
|
||||
/// <param name="next"></param>
|
||||
/// <param name="cancel"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<byte[]> Handle(BurnPdfCommand request, RequestHandlerDelegate<byte[]> next, CancellationToken cancel)
|
||||
{
|
||||
var docResult = await next(cancel);
|
||||
var base64 = Convert.ToBase64String(docResult);
|
||||
return docResult;
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ using Microsoft.Extensions.Options;
|
||||
using QRCoder;
|
||||
using System.Reflection;
|
||||
using GdPicture14;
|
||||
using EnvelopeGenerator.Application.Common.Behaviors;
|
||||
|
||||
namespace EnvelopeGenerator.Application;
|
||||
|
||||
@ -86,6 +87,7 @@ public static class DependencyInjection
|
||||
services.AddMediatR(cfg =>
|
||||
{
|
||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||
cfg.AddBehavior<SaveBurnedPdfBehavior>();
|
||||
});
|
||||
|
||||
// Add memory cache
|
||||
|
||||
@ -1,15 +1,10 @@
|
||||
using CommandDotNet.Execution;
|
||||
using EnvelopeGenerator.Application.ThirdPartyModules.Queries;
|
||||
using EnvelopeGenerator.DependencyInjection;
|
||||
using EnvelopeGenerator.Finalizer;
|
||||
using EnvelopeGenerator.Finalizer.Job;
|
||||
using EnvelopeGenerator.Finalizer.Models;
|
||||
using EnvelopeGenerator.Infrastructure;
|
||||
using MediatR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Quartz;
|
||||
using Quartz.AspNetCore;
|
||||
using Quartz.Impl;
|
||||
using Quartzmon;
|
||||
using Serilog;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user