29 lines
1.6 KiB
C#
29 lines
1.6 KiB
C#
using Heimdall.Application.Common;
|
|||
|
|
using Heimdall.Application.DTOs;
|
||
|
|
|
||
|
|
namespace Heimdall.Application.Services;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Manages global settings and per-agent setting overrides.
|
||
|
|
/// All changes are broadcast to connected agents via SignalR in real-time.
|
||
|
|
/// </summary>
|
||
|
|
public interface ISettingService
|
||
|
|
{
|
||
|
|
// Global settings
|
||
|
|
Task<ServiceResult<List<AppSettingDto>>> GetAllSettingsAsync(CancellationToken ct = default);
|
||
|
|
Task<ServiceResult<AppSettingDto>> GetSettingByKeyAsync(string key, CancellationToken ct = default);
|
||
|
|
Task<ServiceResult<AppSettingDto>> CreateSettingAsync(CreateAppSettingRequest request, CancellationToken ct = default);
|
||
|
|
Task<ServiceResult<AppSettingDto>> UpdateSettingAsync(string key, UpdateAppSettingRequest request, CancellationToken ct = default);
|
||
|
|
Task<ServiceResult> DeleteSettingAsync(string key, CancellationToken ct = default);
|
||
|
|
|
||
|
|
// Agent-specific overrides
|
||
|
|
Task<ServiceResult<List<AgentSettingDto>>> GetAgentSettingsAsync(Guid agentId, CancellationToken ct = default);
|
||
|
|
Task<ServiceResult<AgentSettingDto>> SetAgentSettingAsync(Guid agentId, SetAgentSettingRequest request, CancellationToken ct = default);
|
||
|
|
Task<ServiceResult> RemoveAgentSettingAsync(Guid agentId, string key, CancellationToken ct = default);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Returns the effective configuration for an agent: global defaults merged with
|
||
|
|
/// per-agent overrides. Used by agents to fetch their full config on connect.
|
||
|
|
/// </summary>
|
||
|
|
Task<ServiceResult<Dictionary<string, string>>> GetEffectiveAgentConfigAsync(Guid agentId, CancellationToken ct = default);
|
||
|
|
}
|