Boss.OpenApi
2026.10.5
dotnet add package Boss.OpenApi --version 2026.10.5
NuGet\Install-Package Boss.OpenApi -Version 2026.10.5
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="Boss.OpenApi" Version="2026.10.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Boss.OpenApi" Version="2026.10.5" />
<PackageReference Include="Boss.OpenApi" />
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 Boss.OpenApi --version 2026.10.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Boss.OpenApi, 2026.10.5"
#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 Boss.OpenApi@2026.10.5
#: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=Boss.OpenApi&version=2026.10.5
#tool nuget:?package=Boss.OpenApi&version=2026.10.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Boss.OpenApi
星桥开放服务公共组件 —— 提供开放服务配置、IoC 装配与 RESTful 调用助手,供组件使用方以 .NET 客户端方式接入星桥开放接口。
技术栈
net8.0 | System.Text.Json | 内部基础包 Sup.OpenApi.* / Sup.Kernel.Define.*(经 Boss.Common 传递引用)
核心能力
开放服务配置 OpenBossConfig
| 属性 | 说明 | 默认值 |
|---|---|---|
BaseUrl |
基础 Url | http://127.0.0.1(OpenBossConfigConst.DEFAULT_BASE_URL) |
Token |
接口授权令牌 | token(OpenBossConfigConst.DEFAULT_TOKEN) |
Script |
脚本配置(OpenBossScriptConfig) |
ScriptExecute 默认 /app/script/open/script-execute/v1/execute |
IoC 装配扩展 AddOpenBoss
IocContainerExtension.AddOpenBoss(iocContainer, openBossConfig) —— 引入 OpenBossConfig 所在程序集、添加拉取(Fetching)支持、注册 OpenBossConfig 单例。
RESTful 助手扩展 OpenBossHelperRestfulExtension
OpenBossHelper 上的扩展方法,均返回 OpenApiResult / OpenApiResult<T>:
| 方法 | 说明 |
|---|---|
Get<T>(url) / Get(url) |
GET 请求 |
Post<T>(url, dto) / Post(url, dto) |
POST 请求 |
Put<T>(url, dto) / Put(url, dto) |
PUT 请求 |
Patch<T>(url, dto) / Patch(url, dto) |
PATCH 请求 |
Delete<T>(url) / Delete(url) |
DELETE 请求 |
dto 为 string 时按原始 JSON 内容发送,否则按 CamelCase 策略(含 LocalDateTimeConverter)序列化。
安装
dotnet add package Boss.OpenApi --version 2026.9.1
快速开始
using Boss.OpenApi;
using Boss.OpenApi.Configure;
using Boss.OpenApi.Extension;
using Sup.OpenApi.Extension;
var openBossConfig = new OpenBossConfig
{
BaseUrl = "http://127.0.0.1",
Token = "<接口授权令牌>"
};
// 装配到 IoC 容器
iocContainer.AddOpenBoss(openBossConfig);
// 直接调用开放接口
var helper = new OpenBossHelper(openBossConfig);
var result = await helper.Get<SomeVo>("/app/<功能域>/<资源>/<动作>");
脚本执行开放能力见 Boss.OpenApi.Script 包。
依赖
Boss.Common2026.9.14
| Product | Versions 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.
-
net8.0
- Boss.Common (>= 2026.10.22)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Boss.OpenApi:
| Package | Downloads |
|---|---|
|
Boss.OpenApi.Script
星桥项目开放服务脚本组件 |
GitHub repositories
This package is not used by any popular GitHub repositories.