add realtime config

This commit is contained in:
Holden
2026-07-20 19:13:32 -05:00
parent 550ba21c15
commit 44148f5502
3 changed files with 39 additions and 2 deletions

View File

@@ -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

View File

@@ -24,11 +24,11 @@ public class ConfigController(IConfigService configService) : ControllerBase
[HttpGet("media-player")]
public async Task<ActionResult<MediaPlayerConfigResponse>> 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);
}
}

View File

@@ -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<ActionResult<RealtimeConfigResponse>> GetMediaPlayerConfig(CancellationToken ct = default)
{
var realtimeConfig = await configService.GetAsync(
"Config:RealtimeConfig",
new RealtimeConfigResponse(),
ct);
return Ok(realtimeConfig);
}
}