网站首页 网站源码
website
站点相关全部源代码,隐藏了一些关于服务器的信息
using System.Threading;
using Dpz.Core.Public.ViewModel.RequestEvent;

namespace Dpz.Core.Service.Event;

public class RemoveImagesEvent(IRepository<WaitExecution> repository) : IRequestHandler<RemoveImagesRequest>
{
    public async Task Handle(RemoveImagesRequest request, CancellationToken cancellationToken)
    {
        var images = request.Images ?? [];

        var imageTasks = images
            .Select(x => new WaitExecution
            {
                Category = ExecuteCategory.Delete,
                Relation = x,
                Scheme = ExecuteScheme.DeleteUpyun,
                Status = ExecuteStatus.NotExecute,
                CreateTime = DateTime.Now,
                LastUpdateTime = null
            })
            .ToList();
        
        if (imageTasks.Count > 0)
            await repository.InsertAsync(imageTasks);
    }
}
loading