XFEExtension.NetCore.ServerInteractive 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package XFEExtension.NetCore.ServerInteractive --version 1.0.1
                    
NuGet\Install-Package XFEExtension.NetCore.ServerInteractive -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XFEExtension.NetCore.ServerInteractive" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XFEExtension.NetCore.ServerInteractive" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="XFEExtension.NetCore.ServerInteractive" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XFEExtension.NetCore.ServerInteractive --version 1.0.1
                    
#r "nuget: XFEExtension.NetCore.ServerInteractive, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XFEExtension.NetCore.ServerInteractive@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XFEExtension.NetCore.ServerInteractive&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=XFEExtension.NetCore.ServerInteractive&version=1.0.1
                    
Install as a Cake Tool

XFEExtension.NetCore.ServerInteractive

描述

ServerInteractive是一个C#的DLL库,其负责搭建以XFEExtension.NetCore提供的CyberComm网络架构,让使用者可以快速构建服务器和客户端网络框架

示例(使用前记得进行相应的引用)


搭建服务器端网络框架

使用XFE标准网络架构
var server = XFEServerBuilder.CreateBuilder() // 创建服务器构建器
    .UseXFEServer()                           // 使用XFE服务器架构
    .AddCoreServer(                           // 添加核心服务器
                   XFEServerCoreBuilder.CreateBuilder()                                           // 创建核心服务器构建器
                                       .UseXFEStandardServerCore(                                 // 使用XFE标准服务器核心
                                                static () => UserProfile.UserTable,               // 获取用户表的方法
                                                static () => UserProfile.EncryptedUserLoginModelTable,  // 获取用户加密模型的方法
                                                UserProfile.EncryptedUserLoginModelTable.Add,           // 添加用户加密模型的方法
                                                static user => UserProfile.EncryptedUserLoginModelTable.Remove(user),   // 移除用户加密模型的方法
                                                static () => 7,                                   // 获取登录维持天数方法
                                                XFEDataTableManagerBuilder.CreateBuilder()              // 创建DataTable管理器构建器
                                                                          .AddTable<Person, DataProfile>("人物", (int)UserRole.业务员, (int)UserRole.经理, (int)UserRole.业务员, (int)UserRole.业务员) // 添加名为人物的表格,Person类型,AutoConfig为DataProfile。添加更改获取权限为业务员,移除权限为经理
                                                                          .AddTable<Order, DataProfile>("订单", (int)UserRole.业务员, (int)UserRole.经理, (int)UserRole.业务员, (int)UserRole.业务员)  // 添加名为订单的表格,Order类型,AutoConfig为DataProfile。添加更改获取权限为业务员,移除权限为经理
                                                                          .AddTable<User, UserProfile>("用户", (int)UserRole.经理, (int)UserRole.经理, (int)UserRole.经理, (int)UserRole.业务员))      // 添加名为用户的表格,User类型,AutoConfig为UserProfile。获取权限为业务员,添加移除更改权限为经理
                                       .Build()) // 构建核心服务器
    .Build(); // 构建服务器
await server.Start(); // 启动服务
添加自定义服务
var server = XFEServerBuilder.CreateBuilder()
                             .AddInitializer<MyInitilizerService>() // 自定义初始化服务
                             .AddService<MyService>()               // 自定义服务
                             .AddAsyncService<MyAsyncService>()     // 自定义异步服务
                             .Build();

搭建客户端请求器

使用XFE标准请求器
var xFEClientRequester = XFEClientRequesterBuilder.CreateBuilder("http://localhost:8080/", string.Empty, DeviceHelper.GetUniqueHardwareId()) // 服务器IP地址,用户Session以及硬件编码
                                                  .UseXFEStandardRequest() // 使用XFE标准请求器
                                                  .Build();                // 构建客户端请求器

var result = await xFEClientRequester.Request<(string session, DateTime expireDate)>("login", account, password); // 调用login方法
if (result.StatusCode == System.Net.HttpStatusCode.OK)
{
    Console.WriteLine(result.Result.session);
    Console.WriteLine(result.Result.expireDate);
}
else
{
    Console.WriteLine(result.StatusCode);
    Console.WriteLine(result.Message);
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 0 9/26/2025
1.0.2 0 9/26/2025
1.0.1 40 9/24/2025
1.0.0 31 9/24/2025

## 调整

修复用户登录天数没有传参的bug

## 新增



## 严重