XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEExtension.NetCore.ServerInteractive

[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFEExtension.NetCore.ServerInteractive

Add route validation in AddServiceWithRoute and throw on invalid execute format in AddDataTableManager

Agent-Logs-Url: https://github.com/XFEstudio/XFEExtension.NetCore.ServerInteractive/sessions/632a198a-2082-449f-80f6-deb15f6039f5 Co-authored-by: XFEstudio <132526994+XFEstudio@users.noreply.github.com>

a37941a
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
提交于

代码差异

2 个文件 +7 -5
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Extensions/XFEServerCoreBuilderExtensions.cs +4 -5
@@ -30,11 +30,10 @@ public static class XFEServerCoreBuilderExtensions
30 30 foreach (var execute in xFEDataTableManagerBuilder.ExecuteList)
31 31 {
32 32 var parts = execute.Split('_', 2);
33 if (parts.Length == 2)
34 {
35 var route = $"table/{parts[0]}/{parts[1]}";
36 xFEServerCoreBuilder.AddServiceWithRoute<XFEDataTableManagerService>(route);
37 }
33 if (parts.Length != 2)
34 throw new InvalidOperationException($"执行语句格式无效:'{execute}',期望格式为 '{{operation}}_{{tableName}}'");
35 var route = $"table/{parts[0]}/{parts[1]}";
36 xFEServerCoreBuilder.AddServiceWithRoute<XFEDataTableManagerService>(route);
38 37 }
39 38
40 39 return xFEServerCoreBuilder;
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/XFEServerCoreBuilder.cs +3 -0
@@ -72,6 +72,9 @@ public abstract class XFEServerCoreBuilder : XFEBuilderBase<XFEServerCoreBuilder
72 72 /// <returns>XFE服务器核心构建器</returns>
73 73 public XFEServerCoreBuilder AddServiceWithRoute<T>(string route) where T : IServerCoreStandardService, new()
74 74 {
75 ArgumentException.ThrowIfNullOrWhiteSpace(route, nameof(route));
76 route = route.Trim('/');
77
75 78 _serverStandardCoreServiceDictionary.Add(route, () =>
76 79 {
77 80 var inst = new T();