Enhance channel and settings functionalities: introduce viewer settings in ChannelEndpoints, update SiteSettings to include channel number toggling, and refactor related data structures. Implement new endpoints for validating templates and diffing scheduling changes, improving overall user experience and configuration management.
This commit is contained in:
@@ -9,6 +9,8 @@ using TeleWave.Application.Broadcast.UpdateChannelSettings;
|
||||
using TeleWave.Application.Broadcast.UpdateChannelTime;
|
||||
using TeleWave.Domain.Broadcast;
|
||||
using TeleWave.Infrastructure.Identity;
|
||||
using TeleWave.Application.Broadcast.UpdateViewerSettings;
|
||||
using TeleWave.Application.Programming.Planning.Trace;
|
||||
|
||||
namespace TeleWave.Api.Endpoints;
|
||||
|
||||
@@ -92,10 +94,47 @@ public static partial class ChannelEndpoints
|
||||
admin
|
||||
.MapGet("/{id:guid}/schedule", GetSchedule)
|
||||
.Produces<IReadOnlyList<ScheduleEntryDto>>();
|
||||
admin
|
||||
.MapPut("/{id:guid}/viewer", UpdateViewerSettings)
|
||||
.Produces(StatusCodes.Status204NoContent);
|
||||
|
||||
// «Почему это здесь»: цепочка происхождения записи, записанная в момент генерации.
|
||||
admin.MapGet("/entries/{entryId:guid}/trace", GetEntryTrace).Produces<EntryTraceDto>();
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
private static async Task<IResult> UpdateViewerSettings(
|
||||
Guid id,
|
||||
UpdateViewerSettingsBody body,
|
||||
ISender sender,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
var result = await sender.Send(
|
||||
new UpdateViewerSettingsCommand(
|
||||
id,
|
||||
body.LogoImageId,
|
||||
body.LogoCorner,
|
||||
body.LogoOpacity,
|
||||
body.ShowClock,
|
||||
body.AnalogFilterStrength
|
||||
),
|
||||
cancellationToken
|
||||
);
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
|
||||
private static async Task<IResult> GetEntryTrace(
|
||||
Guid entryId,
|
||||
ISender sender,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
var result = await sender.Send(new GetEntryTraceQuery(entryId), cancellationToken);
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
|
||||
private static async Task<IResult> CreateChannel(
|
||||
CreateChannelCommand command,
|
||||
ISender sender,
|
||||
@@ -203,3 +242,12 @@ public sealed record UpdateChannelSettingsBody(
|
||||
BumperSettingsInput Bumper,
|
||||
Guid? FillerAssetId
|
||||
);
|
||||
|
||||
/// <summary>Оверлеи и аналоговый фильтр — как канал выглядит у зрителя (см. 6.8).</summary>
|
||||
public sealed record UpdateViewerSettingsBody(
|
||||
Guid? LogoImageId,
|
||||
LogoCorner LogoCorner,
|
||||
double LogoOpacity,
|
||||
bool ShowClock,
|
||||
double AnalogFilterStrength
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user