add realtime config
This commit is contained in:
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
21
src/API/Controllers/Realtime/V1/RealtimeController.cs
Normal file
21
src/API/Controllers/Realtime/V1/RealtimeController.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user