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

修复AddUserFunction没有被正确添加到Options里面的问题

5f0e087
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

4 个文件 +17 -10
Modified XFEExtension.NetCore.ServerInteractive/Options/XFEStandardServerCoreOptions.cs +4 -0
@@ -29,6 +29,10 @@ public class XFEStandardServerCoreOptions<T> where T : class
29 29 /// </summary>
30 30 public Func<IEnumerable<User>>? GetUserFunction { get; set; }
31 31 /// <summary>
32 /// 添加用户函数
33 /// </summary>
34 public Action<User>? AddUserFunction { get; set; }
35 /// <summary>
32 36 /// 获取加密用户登录模型函数
33 37 /// </summary>
34 38 public Func<IEnumerable<EncryptedUserLoginModel>>? GetEncryptedUserLoginModelFunction { get; set; }
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Extensions/XFEServerCoreBuilderExtensions.cs +8 -5
@@ -44,13 +44,15 @@ public static class XFEServerCoreBuilderExtensions
44 44 /// </summary>
45 45 /// <typeparam name="T">登录返回用户接口类型</typeparam>
46 46 /// <param name="getUserFunction"></param>
47 /// <param name="addUserFunction"></param>
47 48 /// <param name="getEncryptedUserLoginModelFunction"></param>
48 49 /// <param name="addEncryptedUserLoginModelFunction"></param>
49 50 /// <param name="removeEncryptedUserLoginModelFunction"></param>
50 51 /// <param name="getLoginKeepDays"></param>
51 52 /// <param name="loginResultConvertFunction"></param>
52 53 /// <returns></returns>
53 public XFEServerCoreBuilder AddUserParameterBase<T>(Func<IEnumerable<User>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays, Func<object, T> loginResultConvertFunction) where T : class => xFEServerCoreBuilder.AddParameter("GetUserFunction", getUserFunction)
54 public XFEServerCoreBuilder AddUserParameterBase<T>(Func<IEnumerable<User>> getUserFunction, Action<User> addUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays, Func<object, T> loginResultConvertFunction) where T : class => xFEServerCoreBuilder.AddParameter("GetUserFunction", getUserFunction)
55 .AddParameter("AddUserFunction", addUserFunction)
54 56 .AddParameter("GetEncryptedUserLoginModelFunction", getEncryptedUserLoginModelFunction)
55 57 .AddParameter("AddEncryptedUserLoginModelFunction", addEncryptedUserLoginModelFunction)
56 58 .AddParameter("RemoveEncryptedUserLoginModelFunction", removeEncryptedUserLoginModelFunction)
@@ -107,6 +109,7 @@ public static class XFEServerCoreBuilderExtensions
107 109 /// </summary>
108 110 /// <typeparam name="T">登录返回用户接口类型</typeparam>
109 111 /// <param name="getUserFunction"></param>
112 /// <param name="addUserFunction"></param>
110 113 /// <param name="getEncryptedUserLoginModelFunction"></param>
111 114 /// <param name="addEncryptedUserLoginModelFunction"></param>
112 115 /// <param name="removeEncryptedUserLoginModelFunction"></param>
@@ -114,7 +117,7 @@ public static class XFEServerCoreBuilderExtensions
114 117 /// <param name="xFEDataTableManagerBuilder"></param>
115 118 /// <param name="loginResultConvertFunction"></param>
116 119 /// <returns></returns>
117 public XFEServerCoreBuilder UseXFEStandardServerCore<T>(Func<IEnumerable<User>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays, Func<object, T> loginResultConvertFunction, XFEDataTableManagerBuilder xFEDataTableManagerBuilder) where T : class => xFEServerCoreBuilder.AddUserParameterBase(getUserFunction, getEncryptedUserLoginModelFunction, addEncryptedUserLoginModelFunction, removeEncryptedUserLoginModelFunction, getLoginKeepDays, loginResultConvertFunction)
120 public XFEServerCoreBuilder UseXFEStandardServerCore<T>(Func<IEnumerable<User>> getUserFunction, Action<User> addUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays, Func<object, T> loginResultConvertFunction, XFEDataTableManagerBuilder xFEDataTableManagerBuilder) where T : class => xFEServerCoreBuilder.AddUserParameterBase(getUserFunction, addUserFunction, getEncryptedUserLoginModelFunction, addEncryptedUserLoginModelFunction, removeEncryptedUserLoginModelFunction, getLoginKeepDays, loginResultConvertFunction)
118 121 .AddDataTableManager(xFEDataTableManagerBuilder, getUserFunction, getEncryptedUserLoginModelFunction)
119 122 .AddEntryPointVerify()
120 123 .AddDailyCounterService()
@@ -135,11 +138,11 @@ public static class XFEServerCoreBuilderExtensions
135 138 var builder = xFEServerCoreBuilder;
136 139
137 140 // If user-related functions are provided, add user parameters and login services
138 var hasUserFunctions = options.GetUserFunction is not null && options.GetEncryptedUserLoginModelFunction is not null && options.AddEncryptedUserLoginModelFunction is not null && options.RemoveEncryptedUserLoginModelFunction is not null && options.LoginResultConvertFunction is not null;
141 var hasUserFunctions = options.GetUserFunction is not null && options.AddUserFunction is not null && options.GetEncryptedUserLoginModelFunction is not null && options.AddEncryptedUserLoginModelFunction is not null && options.RemoveEncryptedUserLoginModelFunction is not null && options.LoginResultConvertFunction is not null;
139 142
140 143 if (hasUserFunctions)
141 144 {
142 builder = builder.AddUserParameterBase(options.GetUserFunction!, options.GetEncryptedUserLoginModelFunction!, options.AddEncryptedUserLoginModelFunction!, options.RemoveEncryptedUserLoginModelFunction!, options.GetLoginKeepDays, options.LoginResultConvertFunction!);
145 builder = builder.AddUserParameterBase(options.GetUserFunction!, options.AddUserFunction!, options.GetEncryptedUserLoginModelFunction!, options.AddEncryptedUserLoginModelFunction!, options.RemoveEncryptedUserLoginModelFunction!, options.GetLoginKeepDays, options.LoginResultConvertFunction!);
143 146 }
144 147
145 148 // DataTableManager requires both user functions and a builder
@@ -184,4 +187,4 @@ public static class XFEServerCoreBuilderExtensions
184 187 return xFEServerCoreBuilder.UseXFEStandardServerCore(options);
185 188 }
186 189 }
187 }
190 }
Renamed XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/ServerService/XFEServerCoreProcessService.cs +1 -0
@@ -8,6 +8,7 @@ namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.Serve
8 8 public class XFEServerCoreProcessService : ServerCoreProcessServiceBase
9 9 {
10 10 /// <inheritdoc/>
11 /// <exception cref="ArgumentNullException"></exception>
11 12 public override async Task ProcessServerCore()
12 13 {
13 14 while (true)
Modified XFEExtension.NetCore.ServerInteractive/XFEExtension.NetCore.ServerInteractive.csproj +4 -5
@@ -5,7 +5,7 @@
5 5 <ImplicitUsings>enable</ImplicitUsings>
6 6 <Nullable>enable</Nullable>
7 7 <GenerateDocumentationFile>True</GenerateDocumentationFile>
8 <Version>3.0.4</Version>
8 <Version>3.0.5</Version>
9 9 <Title>XFEExtension.NetCore.ServerInteractive</Title>
10 10 <RepositoryUrl>https://github.com/XFEstudio/XFEExtension.NetCore.ServerInteractive</RepositoryUrl>
11 11 <AnalysisLevel>latest</AnalysisLevel>
@@ -21,10 +21,9 @@
21 21 <PackageReleaseNotes>
22 22 ## 调整
23 23
24 升级版本至3.0.4,添加SourceGenerator分析器引用
25
26 将项目版本号从3.0.3提升至3.0.4,并新增对XFEExtension.NetCore.ServerInteractive.SourceGenerator项目的Analyzer引用,便于在构建时进行源代码分析和生成。此更改不会将其作为程序集包含,仅用于分析器用途。
27
24 修复AddUserFunction没有被正确添加到Options里面的问题
25 版本更新至3.0.5
26
28 27 ## 新增
29 28
30 29