diff --git a/CoreAgent.Domain/Entities/NetworkConfiguration.cs b/CoreAgent.Domain/Entities/NetworkConfiguration.cs
new file mode 100644
index 0000000..1731b0a
--- /dev/null
+++ b/CoreAgent.Domain/Entities/NetworkConfiguration.cs
@@ -0,0 +1,176 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+
+namespace CoreAgent.Domain.Entities
+{
+ ///
+ /// 网络配置实体
+ ///
+ public class NetworkConfiguration : IValidatableObject
+ {
+ ///
+ /// 配置键值
+ ///
+ [Required(ErrorMessage = "配置键值不能为空")]
+ public string ConfigKey { get; set; }
+
+ ///
+ /// RAN配置文件路径
+ ///
+ [Required(ErrorMessage = "RAN配置路径不能为空")]
+ public string RagConfig { get; set; }
+
+ ///
+ /// 核心网和IMS配置列表
+ ///
+ [Required(ErrorMessage = "核心网和IMS配置不能为空")]
+ [MinLength(1, ErrorMessage = "至少需要一个核心网和IMS配置")]
+ public List CoreOrImsConfigs { get; set; }
+
+ ///
+ /// APN配置
+ ///
+ [Required(ErrorMessage = "APN配置不能为空")]
+ public string Apn { get; set; }
+
+ ///
+ /// 频段配置
+ ///
+ [Required(ErrorMessage = "频段配置不能为空")]
+ [MinLength(1, ErrorMessage = "至少需要一个频段配置")]
+ public List Band { get; set; }
+
+ ///
+ /// 配置说明
+ ///
+ public string Comment { get; set; }
+
+ ///
+ /// 验证配置
+ ///
+ public IEnumerable Validate(ValidationContext validationContext)
+ {
+ // 验证PLMN是否重复
+ var plmnGroups = CoreOrImsConfigs.GroupBy(x => x.Plmn);
+ foreach (var group in plmnGroups)
+ {
+ if (group.Count() > 1)
+ {
+ yield return new ValidationResult($"PLMN {group.Key} 重复配置");
+ }
+ }
+
+ // 验证索引是否连续
+ var orderedConfigs = CoreOrImsConfigs.OrderBy(x => x.Index).ToList();
+ for (int i = 0; i < orderedConfigs.Count; i++)
+ {
+ if (orderedConfigs[i].Index != i + 1)
+ {
+ yield return new ValidationResult($"配置索引不连续,期望 {i + 1},实际 {orderedConfigs[i].Index}");
+ }
+ }
+
+ // 验证频段格式
+ foreach (var band in Band)
+ {
+ if (!band.StartsWith("B") || !int.TryParse(band.Substring(1), out _))
+ {
+ yield return new ValidationResult($"频段格式不正确: {band},应为 B1、B2 等格式");
+ }
+ }
+ }
+
+ ///
+ /// 获取指定PLMN的配置
+ ///
+ public CoreImsConfig GetConfigByPlmn(string plmn)
+ {
+ return CoreOrImsConfigs.FirstOrDefault(x => x.Plmn == plmn);
+ }
+
+ ///
+ /// 获取指定索引的配置
+ ///
+ public CoreImsConfig GetConfigByIndex(int index)
+ {
+ return CoreOrImsConfigs.FirstOrDefault(x => x.Index == index);
+ }
+
+ ///
+ /// 验证配置文件是否存在
+ ///
+ public bool ValidateConfigFiles()
+ {
+ if (!System.IO.File.Exists(RagConfig))
+ {
+ throw new InvalidOperationException($"RAN配置文件不存在: {RagConfig}");
+ }
+
+ foreach (var config in CoreOrImsConfigs)
+ {
+ if (!System.IO.File.Exists(config.CoreNetworkConfig))
+ {
+ throw new InvalidOperationException($"核心网配置文件不存在: {config.CoreNetworkConfig}");
+ }
+ if (!System.IO.File.Exists(config.ImsConfig))
+ {
+ throw new InvalidOperationException($"IMS配置文件不存在: {config.ImsConfig}");
+ }
+ }
+
+ return true;
+ }
+ }
+
+ ///
+ /// 核心网和IMS配置实体
+ ///
+ public class CoreImsConfig
+ {
+ ///
+ /// 配置索引
+ ///
+ [Required(ErrorMessage = "配置索引不能为空")]
+ [Range(1, int.MaxValue, ErrorMessage = "配置索引必须大于0")]
+ public int Index { get; set; }
+
+ ///
+ /// PLMN码
+ ///
+ [Required(ErrorMessage = "PLMN码不能为空")]
+ [RegularExpression(@"^\d{5,6}$", ErrorMessage = "PLMN码必须是5-6位数字")]
+ public string Plmn { get; set; }
+
+ ///
+ /// 核心网配置文件路径
+ ///
+ [Required(ErrorMessage = "核心网配置路径不能为空")]
+ [RegularExpression(@"^Config/CoreNetwork/.*\.cfg$", ErrorMessage = "核心网配置路径格式不正确")]
+ public string CoreNetworkConfig { get; set; }
+
+ ///
+ /// IMS配置文件路径
+ ///
+ [Required(ErrorMessage = "IMS配置路径不能为空")]
+ [RegularExpression(@"^Config/Ims/.*\.cfg$", ErrorMessage = "IMS配置路径格式不正确")]
+ public string ImsConfig { get; set; }
+
+ ///
+ /// 获取配置文件的完整路径
+ ///
+ public string GetFullCoreNetworkConfigPath()
+ {
+ return System.IO.Path.GetFullPath(CoreNetworkConfig);
+ }
+
+ ///
+ /// 获取IMS配置文件的完整路径
+ ///
+ public string GetFullImsConfigPath()
+ {
+ return System.IO.Path.GetFullPath(ImsConfig);
+ }
+ }
+}
\ No newline at end of file