GetEnums +EntityType 枚举(Drone/Platform/DetectionEquip/Cloud/Munition)

This commit is contained in:
tian 2026-06-20 12:04:51 +08:00
parent 8bcf4cf675
commit e9c10bfe7d
4 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,7 @@ namespace CounterDrone.Core.Services
public class EnumMetadata
{
public List<EnumItem> DroneType { get; set; } = new();
public List<EnumItem> EntityType { get; set; } = new();
public List<EnumItem> PowerType { get; set; } = new();
public List<EnumItem> PlatformType { get; set; } = new();
public List<EnumItem> AerosolType { get; set; } = new();

View File

@ -235,6 +235,7 @@ namespace CounterDrone.Core.Services
return new EnumMetadata
{
DroneType = EnumToList<Models.DroneType>(TranslateDrone),
EntityType = EnumToList<Models.EntityType>(TranslateEntityType),
PowerType = EnumToList<Models.PowerType>(TranslatePower),
PlatformType = EnumToList<Models.PlatformType>(TranslatePlatform),
AerosolType = EnumToList<Models.AerosolType>(TranslateAerosol),
@ -349,6 +350,16 @@ namespace CounterDrone.Core.Services
_ => r.ToString(),
};
private static string TranslateEntityType(Models.EntityType t) => t switch
{
Models.EntityType.Drone => "无人机",
Models.EntityType.Platform => "发射平台",
Models.EntityType.DetectionEquip => "探测设备",
Models.EntityType.Cloud => "云团",
Models.EntityType.Munition => "弹药",
_ => t.ToString(),
};
// ========== Scenario CRUD ==========
public Scenario UpdateScenario(Scenario scenario)

Binary file not shown.