XFEExtension.NetCore.ServerInteractive
[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore.ServerInteractive.SourceGenerator/EntryPointGenerator.cs
+4
-4
Modified
XFEExtension.NetCore.ServerInteractive.TServer/XFEExtension.NetCore.ServerInteractive.TServer.csproj
+1
-0
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/XFEServerCoreBuilder.cs
+1
-1
XFEstudio/XFEExtension.NetCore.ServerInteractive
Fix EntryPointList per-type isolation, add FlattenHierarchy to reflection, add source generator ref to TServer
Agent-Logs-Url: https://github.com/XFEstudio/XFEExtension.NetCore.ServerInteractive/sessions/2f327390-a46b-45fc-8065-cd5649bef826 Co-authored-by: XFEstudio <132526994+XFEstudio@users.noreply.github.com>
fc8feb0
代码差异
3 个文件
+6
-5
@@ -220,18 +220,18 @@ namespace {namespaceName}
220
220
public partial class {className}{typeParameters}{constraintsSuffix}
221
221
{{
222
222
/// <summary>
223
/// 静态构造函数,用于初始化EntryPointList
223
/// 本类型的入口点路径列表(覆盖基类的空列表)
224
224
/// </summary>
225
static {className}()
225
public new static List<string> EntryPointList {{ get; }} = new()
226
226
{{");
227
227
228
228
// 添加所有入口点到静态列表
229
229
foreach (var method in methodInfos)
230
230
{
231
sourceBuilder.AppendLine($" EntryPointList.Add(\"{EscapeStringLiteral(method.Path)}\");");
231
sourceBuilder.AppendLine($" \"{EscapeStringLiteral(method.Path)}\",");
232
232
}
233
233
234
sourceBuilder.AppendLine($@" }}
234
sourceBuilder.AppendLine($@" }};
235
235
236
236
private Dictionary<string, Action>? _generatedSyncEntryPoints;
237
237
/// <inheritdoc/>
@@ -9,6 +9,7 @@
9
9
10
10
<ItemGroup>
11
11
<ProjectReference Include="..\XFEExtension.NetCore.ServerInteractive\XFEExtension.NetCore.ServerInteractive.csproj" />
12
<ProjectReference Include="..\XFEExtension.NetCore.ServerInteractive.SourceGenerator\XFEExtension.NetCore.ServerInteractive.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
12
13
</ItemGroup>
13
14
14
15
</Project>
@@ -72,7 +72,7 @@ public abstract class XFEServerCoreBuilder : XFEBuilderBase<XFEServerCoreBuilder
72
72
public XFEServerCoreBuilder AddStandardService<T>() where T : IServerCoreStandardService, new()
73
73
{
74
74
// 从T的静态EntryPointList属性获取所有路由路径
75
var entryPointListProperty = typeof(T).GetProperty("EntryPointList", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
75
var entryPointListProperty = typeof(T).GetProperty("EntryPointList", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
76
76
if (entryPointListProperty is null)
77
77
throw new InvalidOperationException($"类型 {typeof(T).Name} 没有静态的 EntryPointList 属性");
78
78