将原单体 MAF1 拆成 MAF1(控制台工作流)和 MAF1.Web(可视化编排)。 抽城市失败时暂停:网页弹确认、CLI 控制台询问,超时采用默认结束查询; 也可改填城市后继续。共享决策模型放在 MAF1.Core。
37 lines
986 B
C#
37 lines
986 B
C#
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace MAF1.Plugins;
|
|
|
|
public sealed class PluginOptions
|
|
{
|
|
public string Directory { get; set; } = "plugins";
|
|
public int DefaultTimeoutSeconds { get; set; } = 180;
|
|
|
|
public string ResolveRoot()
|
|
{
|
|
if (Path.IsPathRooted(Directory))
|
|
{
|
|
return Directory;
|
|
}
|
|
|
|
return Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, Directory));
|
|
}
|
|
|
|
public static PluginOptions Load(IConfiguration config)
|
|
=> config.GetSection("Plugins").Get<PluginOptions>() ?? new PluginOptions();
|
|
}
|
|
|
|
public sealed class LoadedPlugin
|
|
{
|
|
public required string FolderName { get; init; }
|
|
public required string FolderPath { get; init; }
|
|
public required PluginContract.PluginManifest Manifest { get; init; }
|
|
}
|
|
|
|
public sealed class CatalogIssue
|
|
{
|
|
public string Level { get; init; } = "error";
|
|
public string Source { get; init; } = "";
|
|
public string Message { get; init; } = "";
|
|
}
|