You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.0 KiB
70 lines
2.0 KiB
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using CoreAgent.Domain.Entities;
|
|
using CoreAgent.Domain.Interfaces;
|
|
|
|
namespace CoreAgent.Infrastructure.Services
|
|
{
|
|
/// <summary>
|
|
/// 网络配置服务实现
|
|
/// </summary>
|
|
public class NetworkConfigurationService : INetworkConfigurationService
|
|
{
|
|
private readonly INetworkConfigurationRepository _repository;
|
|
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="repository">网络配置仓储</param>
|
|
public NetworkConfigurationService(INetworkConfigurationRepository repository)
|
|
{
|
|
_repository = repository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建网络配置
|
|
/// </summary>
|
|
public Task<NetworkConfiguration> CreateAsync(
|
|
string configKey,
|
|
string ragConfig,
|
|
List<CoreImsConfig> coreOrImsConfigs,
|
|
string apn,
|
|
List<string> band,
|
|
string comment = null)
|
|
{
|
|
return _repository.CreateAsync(configKey, ragConfig, coreOrImsConfigs, apn, band, comment);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存网络配置
|
|
/// </summary>
|
|
public Task SaveAsync(NetworkConfiguration configuration)
|
|
{
|
|
return _repository.SaveAsync(configuration);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除网络配置
|
|
/// </summary>
|
|
public Task DeleteAsync(string configKey)
|
|
{
|
|
return _repository.DeleteAsync(configKey);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取所有网络配置
|
|
/// </summary>
|
|
public Task<List<NetworkConfiguration>> GetAllAsync()
|
|
{
|
|
return _repository.GetAllAsync();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据配置键获取网络配置
|
|
/// </summary>
|
|
public Task<NetworkConfiguration> GetByConfigKeyAsync(string configKey)
|
|
{
|
|
return _repository.GetByConfigKeyAsync(configKey);
|
|
}
|
|
}
|
|
}
|