refactor: 删除未使用的 Models.SimEvent,消除 SimEvent 重名
- 删除 Models/SimEvent.cs(DB表定义,无人读写) - 删除 DatabaseManager 中 CreateTable<SimEvent> 和 CreateIndex - DatabaseManagerTests 表数量 13→12
This commit is contained in:
parent
0f73bbf55e
commit
ced8d4014a
@ -72,14 +72,12 @@ namespace CounterDrone.Core
|
||||
db.CreateTable<Waypoint>();
|
||||
db.CreateTable<Group>();
|
||||
db.CreateTable<SimulationReport>();
|
||||
db.CreateTable<SimEvent>();
|
||||
|
||||
db.CreateIndex("SimTask", "TaskNumber");
|
||||
db.CreateIndex("ControlZone", "TaskId");
|
||||
db.CreateIndex("TargetConfig", "TaskId");
|
||||
db.CreateIndex("EquipmentDeployment", "TaskId");
|
||||
db.CreateIndex("Waypoint", "TaskId");
|
||||
db.CreateIndex("SimEvent", "TaskId");
|
||||
db.CreateIndex("SimulationReport", "TaskId");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using SQLite;
|
||||
|
||||
namespace CounterDrone.Core.Models
|
||||
{
|
||||
/// <summary>仿真事件(数据库记录)</summary>
|
||||
[Table("SimEvent")]
|
||||
public class SimEvent
|
||||
{
|
||||
[PrimaryKey]
|
||||
public string Id { get; set; } = Guid.NewGuid().ToString();
|
||||
|
||||
[Indexed]
|
||||
public string TaskId { get; set; } = string.Empty;
|
||||
|
||||
public double OccurredAt { get; set; }
|
||||
|
||||
public int EventType { get; set; }
|
||||
|
||||
public string SourceId { get; set; } = string.Empty;
|
||||
|
||||
public string TargetId { get; set; } = string.Empty;
|
||||
|
||||
public string DataJson { get; set; } = "{}";
|
||||
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@ -31,13 +31,13 @@ namespace CounterDrone.Core.Tests
|
||||
{
|
||||
var db = _dbManager.OpenMainDb();
|
||||
|
||||
// 验证所有 13 张表存在
|
||||
// 验证所有 12 张表存在
|
||||
var tables = new[]
|
||||
{
|
||||
"ModelInfo", "AmmunitionSpec", "SimTask", "CombatScene",
|
||||
"ControlZone", "TargetConfig", "EquipmentDeployment",
|
||||
"CloudDispersal", "RoutePlan", "Waypoint", "Group",
|
||||
"SimulationReport", "SimEvent"
|
||||
"SimulationReport"
|
||||
};
|
||||
|
||||
foreach (var table in tables)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user