调整 .gitignore 以适配 backends 目录结构

将 MiGu.Server 相关忽略规则迁移至 backends/MiGu.Server,并新增对 .tmp-build* 和 /.cursor/rules 的忽略,优化敏感数据与临时文件的管理。
This commit is contained in:
ArtoriasWu
2026-06-22 08:55:55 +08:00
parent 45f0261ed7
commit 87629a8537
46 changed files with 10 additions and 3 deletions
-65
View File
@@ -1,65 +0,0 @@
namespace MiGu.Server.Configs;
/// <summary>
/// 部署画像 —— 登录后「配置向导」的结果,对应 ConfigStore 的 <c>deployment</c> section
/// (持久化于 <c>data/config-deployment.json</c>)。
///
/// <para>它是「按选型裁剪」的单一事实来源:</para>
/// <list type="number">
/// <item><see cref="Configured"/>=false 时,登录返回 <c>NeedsWizard=true</c>,前端跳转配置向导;</item>
/// <item><see cref="NavigationKinds"/> 经 <see cref="ToActiveSceneIds"/> 映射为 SimpleLite 场景 id
/// 由 Launcher 写入 <c>plugins/active-scenes.json</c> / 透传 <c>--scenes</c>,驱动内核「选择性加载」导航场景插件;</item>
/// <item><see cref="Modules"/> 驱动平台菜单与能力裁剪(PageCatalog 可见页)。</item>
/// </list>
/// </summary>
/// <param name="Configured">向导是否已完成。false = 登录后强制进入配置向导。</param>
/// <param name="PlatformType">平台主定位(仅用于 UI 标题/默认值),如 <c>standard</c> / <c>wcs</c> / <c>wms-wcs</c> / <c>custom</c>。</param>
/// <param name="Modules">启用的功能模块(多选),暂定 <c>wms</c> / <c>ptl</c>。</param>
/// <param name="NavigationKinds">导航方式(多选,一等维度),取值 <c>magnetic</c> / <c>qrcode</c> / <c>laser</c>,与 SimpleCore.NavKind 对齐。</param>
/// <param name="Scenarios">选用的业务场景模板 id(来自 ScenarioTemplateConfig),如 <c>tpl-sps</c> / <c>tpl-pack</c>。</param>
/// <param name="UpdatedBy">最近一次保存向导的用户名(审计用)。</param>
public record DeploymentProfile(
bool Configured,
string PlatformType,
List<string> Modules,
List<string> NavigationKinds,
List<string> Scenarios,
string UpdatedBy)
{
public static DeploymentProfile Default() => new(
Configured: false,
PlatformType: "standard",
Modules: new List<string>(),
NavigationKinds: new List<string>(),
Scenarios: new List<string>(),
UpdatedBy: "");
/// <summary>
/// 导航方式 → SimpleLite 场景 id 映射。与 <c>scene.json.id</c>、<c>SimpleCore.Navigation.NavKind</c>
/// 以及内核 <c>active-scenes.json.activeScenes</c> 一致;这是平台与内核之间「导航选型」的契约约定。
/// </summary>
public static readonly IReadOnlyDictionary<string, string> NavKindToSceneId =
new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
["magnetic"] = "scene.magnetic",
["qrcode"] = "scene.qrcode",
["laser"] = "scene.laser",
};
/// <summary>
/// 把已选 <see cref="NavigationKinds"/> 映射为 SimpleLite 激活场景 id 列表(去重、忽略未知项、保持选择顺序)。
/// 供 Launcher 写 <c>active-scenes.json</c> / 拼 <c>--scenes</c> 参数使用。
/// </summary>
public IReadOnlyList<string> ToActiveSceneIds()
{
var result = new List<string>();
if (NavigationKinds == null) return result;
foreach (var k in NavigationKinds)
{
if (string.IsNullOrWhiteSpace(k)) continue;
if (NavKindToSceneId.TryGetValue(k.Trim(), out var sceneId) && !result.Contains(sceneId))
result.Add(sceneId);
}
return result;
}
}