| 1234567891011121314151617181920 |
- using Application.Abstractions.Messaging;
- using Application.Abstractions.YouTube;
- using SharedKernel.Results;
- namespace Application.Features.Admin.Channel.YouTubePubSub.Unsubscribe;
- internal sealed class Handler(IYouTubePubSubService pubSubService) : ICommandHandler<Command, Result>
- {
- public async Task<Result> Handle(Command request, CancellationToken ct)
- {
- if (string.IsNullOrWhiteSpace(request.YouTubeChannelID))
- {
- return Result.Failure(Error.Problem("YouTubePubSub.ChannelIDRequired", "YouTube Channel ID가 필요합니다."));
- }
- await pubSubService.UnsubscribeAsync(request.YouTubeChannelID, ct);
- return Result.Success();
- }
- }
|