Spec 类命名空间修正:CounterDrone.Core → CounterDrone.Core.Models
- DroneSpec/FireUnitSpec/SensorSpec/EnvironmentSpec/FormationTemplate/RouteTemplate - EnumMetadata 移到 Services 目录 - 238 测试全过
This commit is contained in:
parent
f6d3f1bdb4
commit
fc0a6b0397
@ -1,7 +1,7 @@
|
||||
using CounterDrone.Core.Models;
|
||||
using CounterDrone.Core.Models;
|
||||
using SQLite;
|
||||
|
||||
namespace CounterDrone.Core
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>无人机规格(基础数据模板)</summary>
|
||||
[Table("DroneSpec")]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
using CounterDrone.Core.Models;
|
||||
using CounterDrone.Core.Models;
|
||||
using SQLite;
|
||||
|
||||
namespace CounterDrone.Core
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>环境规格(基础数据模板)</summary>
|
||||
[Table("EnvironmentSpec")]
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using CounterDrone.Core.Models;
|
||||
using SQLite;
|
||||
|
||||
namespace CounterDrone.Core
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>火力单元规格(基础数据模板)</summary>
|
||||
[Table("FireUnitSpec")]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
using CounterDrone.Core.Models;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>编队模板</summary>
|
||||
public class FormationTemplate
|
||||
|
||||
14
src/CounterDrone.Core/Models/PagedResult.cs
Normal file
14
src/CounterDrone.Core/Models/PagedResult.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>分页结果</summary>
|
||||
public class PagedResult<T>
|
||||
{
|
||||
public List<T> Items { get; set; } = new();
|
||||
public int TotalCount { get; set; }
|
||||
public int Page { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
public int TotalPages => (TotalCount + PageSize - 1) / PageSize;
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using CounterDrone.Core.Models;
|
||||
using SQLite;
|
||||
|
||||
namespace CounterDrone.Core
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>航线模板(基础数据模板)</summary>
|
||||
[Table("RouteTemplate")]
|
||||
|
||||
@ -16,14 +16,4 @@ namespace CounterDrone.Core.Models
|
||||
/// <summary>按 WaveId 分组的航路点</summary>
|
||||
public Dictionary<string, List<Waypoint>> WaypointGroups { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>分页结果</summary>
|
||||
public class PagedResult<T>
|
||||
{
|
||||
public List<T> Items { get; set; } = new();
|
||||
public int TotalCount { get; set; }
|
||||
public int Page { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
public int TotalPages => (TotalCount + PageSize - 1) / PageSize;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
using CounterDrone.Core.Models;
|
||||
using CounterDrone.Core.Models;
|
||||
using SQLite;
|
||||
|
||||
namespace CounterDrone.Core
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>传感器规格(基础数据模板)</summary>
|
||||
[Table("SensorSpec")]
|
||||
|
||||
11
src/CounterDrone.Core/Repository/DroneSpecRepository.cs
Normal file
11
src/CounterDrone.Core/Repository/DroneSpecRepository.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using CounterDrone.Core;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Repository
|
||||
{
|
||||
public class DroneSpecRepository : BaseRepository<DroneSpec>
|
||||
{
|
||||
public DroneSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
using CounterDrone.Core;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Repository
|
||||
{
|
||||
public class EnvironmentSpecRepository : BaseRepository<EnvironmentSpec>
|
||||
{
|
||||
public EnvironmentSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
}
|
||||
11
src/CounterDrone.Core/Repository/FireUnitSpecRepository.cs
Normal file
11
src/CounterDrone.Core/Repository/FireUnitSpecRepository.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using CounterDrone.Core;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Repository
|
||||
{
|
||||
public class FireUnitSpecRepository : BaseRepository<FireUnitSpec>
|
||||
{
|
||||
public FireUnitSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
using CounterDrone.Core;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Repository
|
||||
{
|
||||
public class FormationTemplateRepository : BaseRepository<FormationTemplate>
|
||||
{
|
||||
public FormationTemplateRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
}
|
||||
11
src/CounterDrone.Core/Repository/RouteTemplateRepository.cs
Normal file
11
src/CounterDrone.Core/Repository/RouteTemplateRepository.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using CounterDrone.Core;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Repository
|
||||
{
|
||||
public class RouteTemplateRepository : BaseRepository<RouteTemplate>
|
||||
{
|
||||
public RouteTemplateRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
}
|
||||
11
src/CounterDrone.Core/Repository/SensorSpecRepository.cs
Normal file
11
src/CounterDrone.Core/Repository/SensorSpecRepository.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using CounterDrone.Core;
|
||||
using SQLite;
|
||||
using CounterDrone.Core.Models;
|
||||
|
||||
namespace CounterDrone.Core.Repository
|
||||
{
|
||||
public class SensorSpecRepository : BaseRepository<SensorSpec>
|
||||
{
|
||||
public SensorSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
using CounterDrone.Core;
|
||||
using SQLite;
|
||||
|
||||
namespace CounterDrone.Core.Repository
|
||||
{
|
||||
public class FireUnitSpecRepository : BaseRepository<FireUnitSpec>
|
||||
{
|
||||
public FireUnitSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
|
||||
public class DroneSpecRepository : BaseRepository<DroneSpec>
|
||||
{
|
||||
public DroneSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
|
||||
public class SensorSpecRepository : BaseRepository<SensorSpec>
|
||||
{
|
||||
public SensorSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
|
||||
public class EnvironmentSpecRepository : BaseRepository<EnvironmentSpec>
|
||||
{
|
||||
public EnvironmentSpecRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
|
||||
public class FormationTemplateRepository : BaseRepository<FormationTemplate>
|
||||
{
|
||||
public FormationTemplateRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
|
||||
public class RouteTemplateRepository : BaseRepository<RouteTemplate>
|
||||
{
|
||||
public RouteTemplateRepository(SQLiteConnection db) : base(db) { }
|
||||
}
|
||||
}
|
||||
20
src/CounterDrone.Core/Services/EnumMetadata.cs
Normal file
20
src/CounterDrone.Core/Services/EnumMetadata.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CounterDrone.Core.Services
|
||||
{
|
||||
/// <summary>枚举元数据(前端下拉框数据源)</summary>
|
||||
public class EnumMetadata
|
||||
{
|
||||
public Dictionary<string, int> DroneType { get; set; } = new();
|
||||
public Dictionary<string, int> PowerType { get; set; } = new();
|
||||
public Dictionary<string, int> PlatformType { get; set; } = new();
|
||||
public Dictionary<string, int> AerosolType { get; set; } = new();
|
||||
public Dictionary<string, int> WeatherType { get; set; } = new();
|
||||
public Dictionary<string, int> WindDirection { get; set; } = new();
|
||||
public Dictionary<string, int> SceneType { get; set; } = new();
|
||||
public Dictionary<string, int> FormationMode { get; set; } = new();
|
||||
public Dictionary<string, int> TriggerMode { get; set; } = new();
|
||||
public Dictionary<string, int> ReleaseMode { get; set; } = new();
|
||||
public Dictionary<string, int> EquipmentRole { get; set; } = new();
|
||||
}
|
||||
}
|
||||
@ -60,20 +60,4 @@ namespace CounterDrone.Core.Services
|
||||
/// <summary>返回所有枚举定义(供前端下拉框使用)</summary>
|
||||
EnumMetadata GetEnums();
|
||||
}
|
||||
|
||||
/// <summary>枚举元数据</summary>
|
||||
public class EnumMetadata
|
||||
{
|
||||
public Dictionary<string, int> DroneType { get; set; } = new();
|
||||
public Dictionary<string, int> PowerType { get; set; } = new();
|
||||
public Dictionary<string, int> PlatformType { get; set; } = new();
|
||||
public Dictionary<string, int> AerosolType { get; set; } = new();
|
||||
public Dictionary<string, int> WeatherType { get; set; } = new();
|
||||
public Dictionary<string, int> WindDirection { get; set; } = new();
|
||||
public Dictionary<string, int> SceneType { get; set; } = new();
|
||||
public Dictionary<string, int> FormationMode { get; set; } = new();
|
||||
public Dictionary<string, int> TriggerMode { get; set; } = new();
|
||||
public Dictionary<string, int> ReleaseMode { get; set; } = new();
|
||||
public Dictionary<string, int> EquipmentRole { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user