Sup.OpenApi 2026.10.33

dotnet add package Sup.OpenApi --version 2026.10.33
                    
NuGet\Install-Package Sup.OpenApi -Version 2026.10.33
                    
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="Sup.OpenApi" Version="2026.10.33" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sup.OpenApi" Version="2026.10.33" />
                    
Directory.Packages.props
<PackageReference Include="Sup.OpenApi" />
                    
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 Sup.OpenApi --version 2026.10.33
                    
#r "nuget: Sup.OpenApi, 2026.10.33"
                    
#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 Sup.OpenApi@2026.10.33
                    
#: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=Sup.OpenApi&version=2026.10.33
                    
Install as a Cake Addin
#tool nuget:?package=Sup.OpenApi&version=2026.10.33
                    
Install as a Cake Tool

Sup.OpenApi

SUP开放API核心组件 - .NET 8.0 客户端库

NuGet

简介

Sup.OpenApi 是用于连接 SUP 开放 API 平台的 .NET 8.0 客户端库核心组件,提供认证管理、配置存储和 HTTP 请求处理能力。

主要功能

  • 认证管理:支持 JWT Token 和 TenantId 的全局与请求级认证
  • HTTP 请求:自动注入认证头部的 HTTP 请求处理
  • 配置管理:集中式 API 配置管理
  • 依赖注入:与 Eazy Platform IOC 容器无缝集成
  • 结果处理:统一的 API 结果类型封装

安装

dotnet add package Sup.OpenApi

快速开始

1. 基础配置

using Sup.OpenApi.Configure;

var config = new OpenServiceConfig
{
    BaseUrl = "https://api.example.com",
    ServiceCode = "your-service-code",
    SecurityKey = "your-security-key"
};

2. 创建 Helper

using Sup.OpenApi;

var helper = OpenServiceHelper.GetHelper(config);

3. 设置全局认证

// 设置全局认证 - 自动注入到所有请求
OpenServiceUtils.JwtToken = "your-jwt-token";
OpenServiceUtils.TenantId = "your-tenant-id";

4. 设置请求级认证

// 设置特定操作的认证
OpenServiceUtils.AuthToken = "auth-token-from-login";
OpenServiceUtils.AuthSalt = "auth-salt-from-login";

核心类

OpenServiceHelper

核心助手类,持有配置并提供建模和数据库配置访问。

public class OpenServiceHelper
{
    public OpenServiceConfig Config { get; }
    public OpenModelingInfo Modeling { get; }
    public OpenDatabaseInfo Database { get; }
}

OpenServiceUtils

静态工具类,提供全局认证状态管理。

public static class OpenServiceUtils
{
    public static string? JwtToken { get; set; }
    public static string? TenantId { get; set; }
    public static string? AuthToken { get; set; }
    public static string? AuthSalt { get; set; }
}

OpenServiceFetchable

HTTP 请求处理类,自动注入认证头部。

public class OpenServiceFetchable : DefaultFetchable
{
    protected override void ConfigureRequest(HttpRequestMessage request);
}

依赖项

  • Delly.Fetching (>= 2026.4.3) - HTTP 请求基础组件
  • Sup.Common (>= 2026.5.86) - SUP 通用组件

技术栈

  • .NET 8.0
  • C# 12

许可证

MIT License

作者

© 2026 nuoyi.cc

链接

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 (1)

Showing the top 1 NuGet packages that depend on Sup.OpenApi:

Package Downloads
Sup.OpenApi.Kernel

SUP.OpenApi.Kernel 是 SUP 开放 API 平台内核服务的对接组件,提供服务注册、认证、访问和数据接口的连接能力。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.10.33 285 10/16/2026
2026.10.32 258 10/8/2026
2026.9.31 4,744 9/3/2026
2026.9.30 277 9/2/2026
2026.8.29 156 8/31/2026
2026.8.28 151 8/31/2026
2026.8.27 149 8/31/2026
2026.8.26 1,005 8/14/2026
2026.8.25 162 8/13/2026
2026.8.24 166 8/10/2026
2026.7.23 378 7/28/2026
2026.7.22 383 7/8/2026
2026.7.21 179 7/7/2026
2026.7.20 175 7/3/2026
2026.6.19 182 6/25/2026
2026.6.18 181 6/24/2026
2026.6.17 168 6/13/2026
2026.6.16 177 6/13/2026
2026.6.15 175 6/13/2026
2026.6.14 169 6/13/2026
Loading failed