using EnablementBLL.ShowChannel; using EnablementSL.Parameters.ShowChannelSubscription; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; namespace EnablementSL.Endpoints.ShowChannelSubscription; public class SetChannelSubscription : BaseEndpoint> { private readonly IShowChannelSubscriptionBLL _bll; public SetChannelSubscription(IShowChannelSubscriptionBLL bll) => _bll = bll; public override void Configure() { Post("/Enablement/SetChannelSubscription"); AllowAnonymous(); } protected override string? GetCacheKey(SetChannelSubscriptionParameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( SetChannelSubscriptionParameters req, LoginDTO login, CancellationToken ct) => await _bll.SetSubscriptionAsync(req.ChannelId, req.IsSubscribed, login, ct).ConfigureAwait(false); }