- 将菜单实体的 ID 类型从 Guid 改为 long,并配置为自增主键 - 添加菜单创建、删除、树形结构构建等完整的 CRUD 操作支持 - 为文件上传相关端点添加 file:upload 权限验证 - 为文件操作端点添加 file:read 和 file:write 权限控制 - 为通知功能添加 notification:read 权限限制 - 实现 BuildFlow 按钮执行的权限检查机制 - 在 IM 模块中集成 Redis 未读计数器优化性能 - 更新用户主页路径从 /workspace 到 /dashboard/workspace - 添加 SignalR Hub 授权和 WebSocket 连接安全保护 - 新增平台测试项目并完善按钮权限测试用例
59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
namespace BuildFlow.Architecture.Tests;
|
||
|
||
using Xunit;
|
||
|
||
/// <summary>
|
||
/// IM 后台入口种子约束。保证干净库自动具备聊天菜单与会话操作权限。
|
||
/// </summary>
|
||
public class ImEntrySeedTests
|
||
{
|
||
[Fact]
|
||
public void PlatformSeedDataShouldContainImConversationManagePermission()
|
||
{
|
||
var seedData = ReadPlatformSeedData();
|
||
|
||
Assert.Contains("\"im:conversation:manage\"", seedData, StringComparison.Ordinal);
|
||
}
|
||
|
||
[Fact]
|
||
public void PlatformSeedDataShouldContainImChatMenuEntry()
|
||
{
|
||
var seedData = ReadPlatformSeedData();
|
||
|
||
Assert.Contains("\"im\"", seedData, StringComparison.Ordinal);
|
||
Assert.Contains("\"im.chat\"", seedData, StringComparison.Ordinal);
|
||
Assert.Contains("\"/im/chat/index\"", seedData, StringComparison.Ordinal);
|
||
}
|
||
|
||
private static string ReadPlatformSeedData()
|
||
{
|
||
var repoRoot = FindRepoRoot();
|
||
var seedPath = Path.Combine(
|
||
repoRoot.FullName,
|
||
"src",
|
||
"modules",
|
||
"platform",
|
||
"Infrastructure",
|
||
"Persistence",
|
||
"SeedData.cs");
|
||
|
||
return File.ReadAllText(seedPath);
|
||
}
|
||
|
||
private static DirectoryInfo FindRepoRoot()
|
||
{
|
||
var current = new DirectoryInfo(AppContext.BaseDirectory);
|
||
while (current is not null)
|
||
{
|
||
if (File.Exists(Path.Combine(current.FullName, "BuildFlow.slnx")))
|
||
{
|
||
return current;
|
||
}
|
||
|
||
current = current.Parent;
|
||
}
|
||
|
||
throw new InvalidOperationException("无法定位 BuildFlow.slnx,架构测试无法确定仓库边界。");
|
||
}
|
||
}
|