24 lines
952 B
C#
24 lines
952 B
C#
namespace MiGu.Server.Configs;
|
|
|
|
public record FleetGroup(string Id, string Name, string Floor, string Region, List<string> CarIds);
|
|
public record OtaPolicy(bool Enabled, int BatchSize, bool RollbackOnFail);
|
|
public record BatchOpsPolicy(bool ConfirmationRequired, int MaxBatch);
|
|
public record NetworkDiagPolicy(int RttThresholdMs, double PacketLossThreshold);
|
|
|
|
public record FleetLifecycleConfig(
|
|
List<FleetGroup> Groups,
|
|
OtaPolicy Ota,
|
|
BatchOpsPolicy BatchOps,
|
|
NetworkDiagPolicy NetworkDiag)
|
|
{
|
|
public static FleetLifecycleConfig Default() => new(
|
|
Groups: new List<FleetGroup>
|
|
{
|
|
new("G-A", "A 区车队", "F1", "A", new List<string> { "C01", "C02", "C03" }),
|
|
new("G-B", "B 区车队", "F1", "B", new List<string> { "C04", "C05" })
|
|
},
|
|
Ota: new OtaPolicy(true, 2, true),
|
|
BatchOps: new BatchOpsPolicy(true, 10),
|
|
NetworkDiag: new NetworkDiagPolicy(80, 0.02));
|
|
}
|