From 44148f5502cb2c9a3de5040390208195c998c517 Mon Sep 17 00:00:00 2001 From: Holden <122419606+midozen@users.noreply.github.com> Date: Mon, 20 Jul 2026 19:13:32 -0500 Subject: [PATCH] add realtime config --- .../Responses/RealtimeConfigResponse.cs | 16 ++++++++++++++ .../Controllers/Config/V1/ConfigController.cs | 4 ++-- .../Realtime/V1/RealtimeController.cs | 21 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/API/Contracts/Realtime/Responses/RealtimeConfigResponse.cs create mode 100644 src/API/Controllers/Realtime/V1/RealtimeController.cs diff --git a/src/API/Contracts/Realtime/Responses/RealtimeConfigResponse.cs b/src/API/Contracts/Realtime/Responses/RealtimeConfigResponse.cs new file mode 100644 index 0000000..bc7b34d --- /dev/null +++ b/src/API/Contracts/Realtime/Responses/RealtimeConfigResponse.cs @@ -0,0 +1,16 @@ +using System.Text.Json.Serialization; + +namespace API.Contracts.Realtime.Responses; + +public class RealtimeConfigResponse +{ + [JsonPropertyName("RealtimeId")] + public string RealtimeId { get; set; } = "OVERRIDE_ME"; + + [JsonPropertyName("VoiceId")] + public string VoiceId { get; set; } = "OVERRIDE_ME"; + + [JsonPropertyName("NameServer")] + public string NameServer { get; set; } = string.Empty; +} +// fexlar was here, say hi if you see this \ No newline at end of file diff --git a/src/API/Controllers/Config/V1/ConfigController.cs b/src/API/Controllers/Config/V1/ConfigController.cs index 5c0da13..55d9dff 100644 --- a/src/API/Controllers/Config/V1/ConfigController.cs +++ b/src/API/Controllers/Config/V1/ConfigController.cs @@ -24,11 +24,11 @@ public class ConfigController(IConfigService configService) : ControllerBase [HttpGet("media-player")] public async Task> GetMediaPlayerConfig(CancellationToken ct = default) { - var motd = await configService.GetAsync( + var mediaPlayerConfig = await configService.GetAsync( "Config:MediaPlayerConfig", new MediaPlayerConfigResponse(), ct); - return Ok(motd); + return Ok(mediaPlayerConfig); } } \ No newline at end of file diff --git a/src/API/Controllers/Realtime/V1/RealtimeController.cs b/src/API/Controllers/Realtime/V1/RealtimeController.cs new file mode 100644 index 0000000..a1f6681 --- /dev/null +++ b/src/API/Controllers/Realtime/V1/RealtimeController.cs @@ -0,0 +1,21 @@ +using API.Contracts.Realtime.Responses; +using Microsoft.AspNetCore.Mvc; +using RecNet.Application.Common.Interfaces; + +namespace API.Controllers.Realtime.V1; + +[ApiController] +[Route("api/[controller]/v1")] +public class RealtimeController(IConfigService configService) : ControllerBase +{ + [HttpGet] + public async Task> GetMediaPlayerConfig(CancellationToken ct = default) + { + var realtimeConfig = await configService.GetAsync( + "Config:RealtimeConfig", + new RealtimeConfigResponse(), + ct); + + return Ok(realtimeConfig); + } +} \ No newline at end of file