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

添加泛型传参,待测试

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

代码差异

9 个文件 +56 -33
Modified XFEExtension.NetCore.ServerInteractive.TServer/Program.cs +3 -1
@@ -1,4 +1,5 @@
1 1 using XFEExtension.NetCore.ServerInteractive.Interfaces;
2 using XFEExtension.NetCore.ServerInteractive.Models;
2 3 using XFEExtension.NetCore.ServerInteractive.Models.UserModels;
3 4 using XFEExtension.NetCore.ServerInteractive.TServer;
4 5 using XFEExtension.NetCore.ServerInteractive.TServer.Models;
@@ -11,12 +12,13 @@ var server = XFEServerBuilder.CreateBuilder() //创建服务器构建器
11 12 .UseXFEServer() //使用XFE服务器架构
12 13 .AddCoreServer( //添加核心服务器
13 14 XFEServerCoreBuilder.CreateBuilder() //创建核心服务器构建器
14 .UseXFEStandardServerCore<IUserFaceInfo>( //使用XFE标准服务器核心
15 .UseXFEStandardServerCore<User, IUserFaceInfo>( //使用XFE标准服务器核心 泛型:<存储的用户类型, 登录返回的用户模型>
15 16 static () => UserProfile.UserTable, //获取用户表的方法
16 17 static () => UserProfile.EncryptedUserLoginModelTable, //获取用户加密模型的方法
17 18 UserProfile.EncryptedUserLoginModelTable.Add, //添加用户加密模型的方法
18 19 static user => UserProfile.EncryptedUserLoginModelTable.Remove(user), //移除用户加密模型的方法
19 20 static () => 7, // 获取登录维持天数方法
21 static user => user, //登录返回用户转换方法
20 22 XFEDataTableManagerBuilder.CreateBuilder() //创建DataTable管理器构建器
21 23 .AddTable<Person, DataProfile>("人物", (int)UserRole.业务员, (int)UserRole.经理, (int)UserRole.业务员, (int)UserRole.业务员) //添加名为人物的表格,Person类型,AutoConfig为DataProfile。添加更改获取权限为业务员,移除权限为经理
22 24 .AddTable<Order, DataProfile>("订单", (int)UserRole.业务员, (int)UserRole.经理, (int)UserRole.业务员, (int)UserRole.业务员) //添加名为订单的表格,Order类型,AutoConfig为DataProfile。添加更改获取权限为业务员,移除权限为经理
Modified XFEExtension.NetCore.ServerInteractive/Interfaces/IUserServiceBase.cs +3 -3
@@ -6,7 +6,7 @@ namespace XFEExtension.NetCore.ServerInteractive.Interfaces;
6 6 /// <summary>
7 7 /// 用户服务基类
8 8 /// </summary>
9 public interface IUserServiceBase
9 public interface IUserServiceBase<T> where T : IUserInfo
10 10 {
11 11 /// <summary>
12 12 /// Json序列化设置
@@ -23,7 +23,7 @@ public interface IUserServiceBase
23 23 /// <summary>
24 24 /// 添加用户方法
25 25 /// </summary>
26 Action<IUserInfo> AddUserFunction { get; set; }
26 Action<T> AddUserFunction { get; set; }
27 27 /// <summary>
28 28 /// 获取加密用户模型方法
29 29 /// </summary>
@@ -35,5 +35,5 @@ public interface IUserServiceBase
35 35 /// <summary>
36 36 /// 获取用户方法
37 37 /// </summary>
38 Func<IEnumerable<IUserInfo>> GetUserFunction { get; set; }
38 Func<IEnumerable<T>> GetUserFunction { get; set; }
39 39 }
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/IpBannerService.cs +5 -4
@@ -1,4 +1,5 @@
1 1 using System.Net;
2 using XFEExtension.NetCore.ServerInteractive.Interfaces;
2 3 using XFEExtension.NetCore.ServerInteractive.Models.ServerModels;
3 4 using XFEExtension.NetCore.ServerInteractive.Profiles;
4 5 using XFEExtension.NetCore.ServerInteractive.Utilities.Helpers;
@@ -10,7 +11,7 @@ namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreS
10 11 /// <summary>
11 12 /// IP封禁服务
12 13 /// </summary>
13 public class IpBannerService : ServerCoreUserServiceBase
14 public class IpBannerService<T> : ServerCoreUserServiceBase<T> where T : IUserInfo
14 15 {
15 16 /// <summary>
16 17 /// 获取权限
@@ -31,12 +32,12 @@ public class IpBannerService : ServerCoreUserServiceBase
31 32 {
32 33 case "get_bannedIpList":
33 34 Console.Write($"【{r.Args.ClientIP}】获取禁止的IP地址列表请求");
34 UserHelper.ValidatePermission(queryableJsonNode["session"], queryableJsonNode["computerInfo"], r.Args.ClientIP, GetPermission, GetEncryptedUserLoginModelFunction(), GetUserFunction(), r);
35 UserHelper.ValidatePermission(queryableJsonNode["session"], queryableJsonNode["computerInfo"], r.Args.ClientIP, GetPermission, GetEncryptedUserLoginModelFunction(), GetUserFunction().Cast<IUserInfo>(), r);
35 36 await r.Args.ReplyAndClose(ServerBaseProfile.BannedIPAddressList.ToJson());
36 37 break;
37 38 case "add_bannedIp":
38 39 Console.WriteLine($"【{r.Args.ClientIP}】添加禁止的IP地址请求 添加:{queryableJsonNode["bannedIp"]}");
39 UserHelper.ValidatePermission(queryableJsonNode["session"], queryableJsonNode["computerInfo"], r.Args.ClientIP, AddPermission, GetEncryptedUserLoginModelFunction(), GetUserFunction(), r);
40 UserHelper.ValidatePermission(queryableJsonNode["session"], queryableJsonNode["computerInfo"], r.Args.ClientIP, AddPermission, GetEncryptedUserLoginModelFunction(), GetUserFunction().Cast<IUserInfo>(), r);
40 41 if (queryableJsonNode["bannedIp"] is null) r.Error("无IP地址传入", HttpStatusCode.BadRequest);
41 42 ServerBaseProfile.BannedIPAddressList.Add(new()
42 43 {
@@ -47,7 +48,7 @@ public class IpBannerService : ServerCoreUserServiceBase
47 48 break;
48 49 case "remove_bannedIp":
49 50 Console.WriteLine($"【{r.Args.ClientIP}】删除禁止的IP地址请求 移除:{queryableJsonNode["bannedIp"]}");
50 UserHelper.ValidatePermission(queryableJsonNode["session"], queryableJsonNode["computerInfo"], r.Args.ClientIP, RemovePermission, GetEncryptedUserLoginModelFunction(), GetUserFunction(), r);
51 UserHelper.ValidatePermission(queryableJsonNode["session"], queryableJsonNode["computerInfo"], r.Args.ClientIP, RemovePermission, GetEncryptedUserLoginModelFunction(), GetUserFunction().Cast<IUserInfo>(), r);
51 52 var targetIp = ServerBaseProfile.BannedIPAddressList.FirstOrDefault(ip => ip.IPAddress == queryableJsonNode["bannedIp"].ToString()) ?? throw r.GetError("无IP地址传入", HttpStatusCode.BadRequest);
52 53 await r.Args.ReplyAndClose(ServerBaseProfile.BannedIPAddressList.Remove(targetIp).ToString());
53 54 break;
Added XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/ServerCoreUserLoginServiceBase.cs +12 -0
@@ -0,0 +1,12 @@
1 using XFEExtension.NetCore.ServerInteractive.Interfaces;
2
3 namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreService;
4
5 ///<inheritdoc/>
6 public abstract class ServerCoreUserLoginServiceBase<T, F> : ServerCoreUserServiceBase<T> where T : IUserInfo where F : class
7 {
8 /// <summary>
9 /// 登录结果转换方法
10 /// </summary>
11 public Func<T, F> LoginResultConverter { get; set; } = static user => (F)(object)user;
12 }
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/ServerCoreUserServiceBase.cs +3 -3
@@ -7,16 +7,16 @@ using XFEExtension.NetCore.ServerInteractive.Utilities.JsonConverter;
7 7 namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreService;
8 8
9 9 /// <inheritdoc/>
10 public abstract class ServerCoreUserServiceBase : ServerCoreStandardRegisterAsyncServiceBase, IUserServiceBase
10 public abstract class ServerCoreUserServiceBase<T> : ServerCoreStandardRegisterAsyncServiceBase, IUserServiceBase<T> where T : IUserInfo
11 11 {
12 12 /// <inheritdoc/>
13 public Func<IEnumerable<IUserInfo>> GetUserFunction { get; set; } = () => [];
13 public Func<IEnumerable<T>> GetUserFunction { get; set; } = () => [];
14 14 /// <inheritdoc/>
15 15 public Func<IEnumerable<EncryptedUserLoginModel>> GetEncryptedUserLoginModelFunction { get; set; } = () => [];
16 16 /// <inheritdoc/>
17 17 public Action<EncryptedUserLoginModel> AddEncryptedUserLoginModelFunction { get; set; } = _ => { };
18 18 /// <inheritdoc/>
19 public Action<IUserInfo> AddUserFunction { get; set; } = _ => { };
19 public Action<T> AddUserFunction { get; set; } = _ => { };
20 20 /// <inheritdoc/>
21 21 public Func<int> GetLoginKeepDays { get; set; } = () => 7;
22 22 /// <inheritdoc/>
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/UserLoginService.cs +4 -4
@@ -12,7 +12,7 @@ namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreS
12 12 /// <summary>
13 13 /// 用户登录服务
14 14 /// </summary>
15 public class UserLoginService<T> : ServerCoreUserServiceBase where T : IUserFaceInfo
15 public class UserLoginService<T, F> : ServerCoreUserLoginServiceBase<T, F> where T : IUserInfo where F : class
16 16 {
17 17 /// <inheritdoc/>
18 18 public override async Task StandardRequestReceived(string execute, QueryableJsonNode queryableJsonNode, ServerCoreReturnArgs r)
@@ -24,7 +24,7 @@ public class UserLoginService<T> : ServerCoreUserServiceBase where T : IUserFace
24 24 if (account.IsNullOrWhiteSpace()) r.Error("账户名不能为空", HttpStatusCode.BadRequest);
25 25 if (password.IsNullOrWhiteSpace()) r.Error("登录密码不能为空", HttpStatusCode.BadRequest);
26 26 if (computerInfo.IsNullOrWhiteSpace()) r.Error("电脑信息不能为空", HttpStatusCode.BadRequest);
27 var user = UserHelper.GetUser(queryableJsonNode["account"], queryableJsonNode["password"], GetUserFunction(), r);
27 var user = UserHelper.GetUser(queryableJsonNode["account"], queryableJsonNode["password"], GetUserFunction().Cast<IUserInfo>(), r);
28 28 Console.WriteLine($"{account}({computerInfo})");
29 29 var userLoginList = GetEncryptedUserLoginModelFunction().Where(userLogin => userLogin.UserLoginModel.ComputerInfo == computerInfo);
30 30 var userLogin = GetEncryptedUserLoginModelFunction().FirstOrDefault(userLogin => userLogin.UserLoginModel.UID == user.ID);
@@ -57,7 +57,7 @@ public class UserLoginService<T> : ServerCoreUserServiceBase where T : IUserFace
57 57 {
58 58 session = $"{user.ID}|{UserHelper.Encrypt(userLogin.Key, userLogin.UserLoginModel)}",
59 59 expireDate = userLogin.UserLoginModel.EndDateTime,
60 userInfo = (T)user
60 userInfo = LoginResultConverter((T)user)
61 61 }.ToJson(), HttpStatusCode.OK);
62 62 }
63 63 else
@@ -70,7 +70,7 @@ public class UserLoginService<T> : ServerCoreUserServiceBase where T : IUserFace
70 70 {
71 71 session = $"{user.ID}|{UserHelper.Encrypt(userLogin.Key, userLogin.UserLoginModel)}",
72 72 expireDate = userLogin.UserLoginModel.EndDateTime,
73 userInfo = (T)user
73 userInfo = LoginResultConverter((T)user)
74 74 }.ToJson(), HttpStatusCode.OK);
75 75 }
76 76 }
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/UserReloginService.cs +3 -3
@@ -13,7 +13,7 @@ namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreS
13 13 /// <summary>
14 14 /// 用户登录校验服务
15 15 /// </summary>
16 public class UserReloginService<T> : ServerCoreUserServiceBase where T : IUserFaceInfo
16 public class UserReloginService<T, F> : ServerCoreUserLoginServiceBase<T, F> where T : IUserInfo where F : class
17 17 {
18 18 /// <inheritdoc/>
19 19 public override async Task StandardRequestReceived(string execute, QueryableJsonNode queryableJsonNode, ServerCoreReturnArgs r)
@@ -30,10 +30,10 @@ public class UserReloginService<T> : ServerCoreUserServiceBase where T : IUserFa
30 30 var userLoginModel = UserHelper.Decrypt<UserLoginModel>(encryptedUserLoginModel.Key, split[1]);
31 31 if (userLoginModel.UID.IsNullOrWhiteSpace() || userLoginModel.UID != encryptedUserLoginModel.UserLoginModel.UID)
32 32 r.Error("登录用户ID不匹配", HttpStatusCode.Forbidden);
33 var user = UserHelper.GetUser(userLoginModel.UID, GetUserFunction()) ?? throw r.GetError("用户ID未注册", HttpStatusCode.Forbidden);
33 var user = UserHelper.GetUser(userLoginModel.UID, GetUserFunction().Cast<IUserFaceInfo>()) ?? throw r.GetError("用户ID未注册", HttpStatusCode.Forbidden);
34 34 if (userLoginModel.LastIPAddress != r.Args.ClientIP) r.Error("IP地址不匹配", HttpStatusCode.Forbidden);
35 35 if (userLoginModel.LastIPAddress != encryptedUserLoginModel.UserLoginModel.LastIPAddress) r.Error("IP地址不匹配", HttpStatusCode.Forbidden);
36 36 if (userLoginModel.EndDateTime < DateTime.Now) r.Error("登录已过期", HttpStatusCode.Forbidden);
37 await r.Args.ReplyAndClose(((T)user).ToJson());
37 await r.Args.ReplyAndClose(LoginResultConverter((T)user).ToJson());
38 38 }
39 39 }
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/UserServiceBase.cs +3 -3
@@ -6,10 +6,10 @@ using XFEExtension.NetCore.ServerInteractive.Utilities.JsonConverter;
6 6 namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.CoreService;
7 7
8 8 /// <inheritdoc/>
9 public abstract class UserServiceBase : IUserServiceBase
9 public abstract class UserServiceBase<T> : IUserServiceBase<T> where T : IUserInfo
10 10 {
11 11 /// <inheritdoc/>
12 public Func<IEnumerable<IUserInfo>> GetUserFunction { get; set; } = () => [];
12 public Func<IEnumerable<T>> GetUserFunction { get; set; } = () => [];
13 13 /// <inheritdoc/>
14 14 public Func<IEnumerable<EncryptedUserLoginModel>> GetEncryptedUserLoginModelFunction { get; set; } = () => [];
15 15 /// <inheritdoc/>
@@ -17,7 +17,7 @@ public abstract class UserServiceBase : IUserServiceBase
17 17 /// <inheritdoc/>
18 18 public Action<EncryptedUserLoginModel> RemoveEncryptedUserLoginModelFunction { get; set; } = _ => { };
19 19 /// <inheritdoc/>
20 public Action<IUserInfo> AddUserFunction { get; set; } = _ => { };
20 public Action<T> AddUserFunction { get; set; } = _ => { };
21 21 /// <inheritdoc/>
22 22 public Func<int> GetLoginKeepDays { get; set; } = () => 7;
23 23 /// <inheritdoc/>
Modified XFEExtension.NetCore.ServerInteractive/Utilities/XFEServerCoreBuilderExtensions.cs +20 -12
@@ -19,40 +19,46 @@ public static class XFEServerCoreBuilderExtensions
19 19 /// <param name="getUserFunction"></param>
20 20 /// <param name="getEncryptedUserLoginModelFunction"></param>
21 21 /// <returns></returns>
22 public static XFEServerCoreBuilder AddDataTableManager(this XFEServerCoreBuilder xFEServerCoreBuilder, XFEDataTableManagerBuilder xFEDataTableManagerBuilder, Func<IEnumerable<User>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction) => xFEServerCoreBuilder.AddParameter("TableManager", xFEDataTableManagerBuilder.Build(getUserFunction, getEncryptedUserLoginModelFunction)).RegisterStandardAsyncService<XFEDataTableManagerService>(xFEDataTableManagerBuilder.ExecuteList);
22 public static XFEServerCoreBuilder AddDataTableManager(this XFEServerCoreBuilder xFEServerCoreBuilder, XFEDataTableManagerBuilder xFEDataTableManagerBuilder, Func<IEnumerable<IUserInfo>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction) => xFEServerCoreBuilder.AddParameter("TableManager", xFEDataTableManagerBuilder.Build(getUserFunction, getEncryptedUserLoginModelFunction)).RegisterStandardAsyncService<XFEDataTableManagerService>(xFEDataTableManagerBuilder.ExecuteList);
23 23
24 24 /// <summary>
25 25 /// 添加用户基本参数
26 26 /// </summary>
27 /// <typeparam name="T">用户登录模型</typeparam>
28 /// <typeparam name="F">登录返回用户接口类型</typeparam>
27 29 /// <param name="xFEServerCoreBuilder"></param>
28 30 /// <param name="getUserFunction"></param>
29 31 /// <param name="getEncryptedUserLoginModelFunction"></param>
30 32 /// <param name="addEncryptedUserLoginModelFunction"></param>
31 33 /// <param name="removeEncryptedUserLoginModelFunction"></param>
32 34 /// <param name="getLoginKeepDays"></param>
35 /// <param name="loginResultConverter"></param>
33 36 /// <returns></returns>
34 public static XFEServerCoreBuilder AddUserParameterBase(this XFEServerCoreBuilder xFEServerCoreBuilder, Func<IEnumerable<User>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays) => xFEServerCoreBuilder.AddParameter("GetUserFunction", getUserFunction)
37 public static XFEServerCoreBuilder AddUserParameterBase<T, F>(this XFEServerCoreBuilder xFEServerCoreBuilder, Func<IEnumerable<T>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays, Func<T, F> loginResultConverter) where T : IUserInfo where F : class => xFEServerCoreBuilder.AddParameter("GetUserFunction", getUserFunction)
35 38 .AddParameter("GetEncryptedUserLoginModelFunction", getEncryptedUserLoginModelFunction)
36 39 .AddParameter("AddEncryptedUserLoginModelFunction", addEncryptedUserLoginModelFunction)
37 40 .AddParameter("RemoveEncryptedUserLoginModelFunction", removeEncryptedUserLoginModelFunction)
38 .AddParameter("GetLoginKeepDays", getLoginKeepDays);
41 .AddParameter("GetLoginKeepDays", getLoginKeepDays)
42 .AddParameter("LoginResultConverter", loginResultConverter);
39 43
40 44 /// <summary>
41 45 /// 使用XFE标准登录服务
42 46 /// </summary>
43 /// <typeparam name="T">登录返回用户接口类型</typeparam>
47 /// <typeparam name="T">用户登录模型</typeparam>
48 /// <typeparam name="F">登录返回用户接口类型</typeparam>
44 49 /// <param name="xFEServerCoreBuilder"></param>
45 50 /// <returns></returns>
46 public static XFEServerCoreBuilder AddStandardLoginService<T>(this XFEServerCoreBuilder xFEServerCoreBuilder) where T : IUserFaceInfo => xFEServerCoreBuilder.RegisterStandardAsyncService<UserLoginService<T>>("login")
47 .RegisterStandardAsyncService<UserReloginService<T>>("relogin")
51 public static XFEServerCoreBuilder AddStandardLoginService<T, F>(this XFEServerCoreBuilder xFEServerCoreBuilder) where T : IUserInfo where F : class => xFEServerCoreBuilder.RegisterStandardAsyncService<UserLoginService<T, F>>("login")
52 .RegisterStandardAsyncService<UserReloginService<T, F>>("relogin")
48 53 .AddService<UserLoginAutoCleanService>();
49 54
50 55 /// <summary>
51 56 /// 添加IP封禁服务
52 57 /// </summary>
58 /// <typeparam name="T">用户登录模型</typeparam>
53 59 /// <param name="xFEServerCoreBuilder"></param>
54 60 /// <returns></returns>
55 public static XFEServerCoreBuilder AddIpBannerService(this XFEServerCoreBuilder xFEServerCoreBuilder) => xFEServerCoreBuilder.RegisterStandardAsyncService<IpBannerService>(["get_bannedIpList", "add_bannedIp", "remove_bannedIp"]);
61 public static XFEServerCoreBuilder AddIpBannerService<T>(this XFEServerCoreBuilder xFEServerCoreBuilder) where T : IUserInfo => xFEServerCoreBuilder.RegisterStandardAsyncService<IpBannerService<T>>(["get_bannedIpList", "add_bannedIp", "remove_bannedIp"]);
56 62
57 63 /// <summary>
58 64 /// 添加日期统计服务
@@ -85,21 +91,23 @@ public static class XFEServerCoreBuilderExtensions
85 91 /// <summary>
86 92 /// 使用XFE标准服务器核心
87 93 /// </summary>
88 /// <typeparam name="T">登录返回用户接口类型</typeparam>
94 /// <typeparam name="T">用户登录模型</typeparam>
95 /// <typeparam name="F">登录返回用户接口类型</typeparam>
89 96 /// <param name="xFEServerCoreBuilder"></param>
90 97 /// <param name="getUserFunction"></param>
91 98 /// <param name="getEncryptedUserLoginModelFunction"></param>
92 99 /// <param name="addEncryptedUserLoginModelFunction"></param>
93 100 /// <param name="removeEncryptedUserLoginModelFunction"></param>
94 101 /// <param name="getLoginKeepDays"></param>
102 /// <param name="loginResultConverter"></param>
95 103 /// <param name="xFEDataTableManagerBuilder"></param>
96 104 /// <returns></returns>
97 public static XFEServerCoreBuilder UseXFEStandardServerCore<T>(this XFEServerCoreBuilder xFEServerCoreBuilder, Func<IEnumerable<User>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays, XFEDataTableManagerBuilder xFEDataTableManagerBuilder) where T : IUserFaceInfo => xFEServerCoreBuilder.AddUserParameterBase(getUserFunction, getEncryptedUserLoginModelFunction, addEncryptedUserLoginModelFunction, removeEncryptedUserLoginModelFunction, getLoginKeepDays)
98 .AddDataTableManager(xFEDataTableManagerBuilder, getUserFunction, getEncryptedUserLoginModelFunction)
105 public static XFEServerCoreBuilder UseXFEStandardServerCore<T, F>(this XFEServerCoreBuilder xFEServerCoreBuilder, Func<IEnumerable<T>> getUserFunction, Func<IEnumerable<EncryptedUserLoginModel>> getEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> addEncryptedUserLoginModelFunction, Action<EncryptedUserLoginModel> removeEncryptedUserLoginModelFunction, Func<int> getLoginKeepDays, Func<T, F> loginResultConverter, XFEDataTableManagerBuilder xFEDataTableManagerBuilder) where T : IUserInfo where F : class => xFEServerCoreBuilder.AddUserParameterBase(getUserFunction, getEncryptedUserLoginModelFunction, addEncryptedUserLoginModelFunction, removeEncryptedUserLoginModelFunction, getLoginKeepDays, loginResultConverter)
106 .AddDataTableManager(xFEDataTableManagerBuilder, () => getUserFunction().Cast<IUserInfo>(), getEncryptedUserLoginModelFunction)
99 107 .AddEntryPotinVerify()
100 108 .AddDailyCounterService()
101 109 .AddXFEErrorProcessService()
102 110 .AddConnectService()
103 .AddStandardLoginService<T>()
104 .AddIpBannerService();
111 .AddStandardLoginService<T, F>()
112 .AddIpBannerService<T>();
105 113 }