UplodFile
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Mapster;
|
using Grpc.Core;
|
||||||
|
using Mapster;
|
||||||
using Vizhtalk.CDN.Presentation.Application.Exceptions;
|
using Vizhtalk.CDN.Presentation.Application.Exceptions;
|
||||||
using Vizhtalk.CDN.Presentation.Domain.Entities;
|
using Vizhtalk.CDN.Presentation.Domain.Entities;
|
||||||
using VizhTalk.BuildingBlocks.Application.Configuration.Commnad;
|
using VizhTalk.BuildingBlocks.Application.Configuration.Commnad;
|
||||||
@@ -23,3 +24,11 @@ public class CreateMediaGroupCommandHandler(IUnitOfWork unitOfWork, CDNGrpc.CDNG
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class UploadFileCommandHandler(IUnitOfWork unitOfWork, CDNGrpc.CDNGrpcClient cdnClient) : ICommandHandler<UploadFileCommand, UploadFileDTO>
|
||||||
|
{
|
||||||
|
public Task<UploadFileDTO> Handle(UploadFileCommand request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Mapster;
|
||||||
|
using Vizhtalk.CDN.Presentation.Domain.Entities;
|
||||||
|
using VizhTalk.Grpc.CDN;
|
||||||
|
|
||||||
|
namespace Vizhtalk.CDN.Presentation.Application.Mappers;
|
||||||
|
|
||||||
|
public class MapperConfig
|
||||||
|
{
|
||||||
|
|
||||||
|
public static void Process()
|
||||||
|
{
|
||||||
|
|
||||||
|
var config = TypeAdapterConfig<MediaGroup, MediaGroupDTO>.NewConfig()
|
||||||
|
.MapWith(lan => new MediaGroupDTO()
|
||||||
|
{
|
||||||
|
Id = lan.Id.Value
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
config.Compile();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
using Grpc.Core;
|
using Grpc.Core;
|
||||||
|
using Vizhtalk.CDN.Presentation.Application;
|
||||||
using VizhTalk.Grpc.CDN;
|
using VizhTalk.Grpc.CDN;
|
||||||
|
|
||||||
namespace Vizhtalk.CDN.Presentation.Services;
|
namespace Vizhtalk.CDN.Presentation.Services;
|
||||||
|
|
||||||
public class CDNService : CDNGrpc.CDNGrpcBase
|
public class CDNService(ICDNModule cDNModule) : CDNGrpc.CDNGrpcBase
|
||||||
{
|
{
|
||||||
public override Task<MediaGroupDTO> CreateMediaGroup(CreateMediaGroupCommand request, ServerCallContext context)
|
public override async Task<MediaGroupDTO> CreateMediaGroup(CreateMediaGroupCommand request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
return base.CreateMediaGroup(request, context);
|
return await cDNModule.Execute(request, context.CancellationToken);
|
||||||
}
|
}
|
||||||
public override Task<UploadFileDTO> UploadFile(UploadFileCommand request, ServerCallContext context)
|
public override async Task<UploadFileDTO> UploadFile(UploadFileCommand request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
return base.UploadFile(request, context);
|
return await cDNModule.Execute(request, context.CancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,4 @@
|
|||||||
<ProjectReference Include="..\VizhTalk.Grpc.CDN\VizhTalk.Grpc.CDN.csproj" />
|
<ProjectReference Include="..\VizhTalk.Grpc.CDN\VizhTalk.Grpc.CDN.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Application\Mappers\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user