Liwendong.Frameworks.Services.API 1.16.0

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

Liwendong.Frameworks.Services.API

框架内服务API,提供一些常用的服务API,方便快速使用

更新日志

V1.16.0

  • VerifyCodeAuthorizeAttribute: 添加了 AllowAnonymousAttribute 属性的过滤

V1.15.0

  • 命名修正:WexinOAuth 类名拼写错误*:
    • WexinOAuthAccessTokenResult → WeixinOAuthAccessTokenResult(正确拼写)
    • WexinOAuthUserInfoResult → WeixinOAuthUserInfoResult(正确拼写)
    • 旧类名保留为 [Obsolete] 别名(继承自新类),向后兼容,未来版本将移除。
    • WeixinMPServiesAPI 内部调用已改用新类名。
  • 枚举注释:ServiesTypes 枚举新增注释说明命名约定(大部分枚举值使用 "Servies" 拼写为历史遗留,WeixinOrderServices 使用正确拼写,为保持向后兼容不做统一修正)。

V1.14.0

  • 新增:服务间调用熔断器(Polly):
    • 新增 CircuitBreakerManager:按 ServiesTypes(目标服务类型)各维护一个独立熔断器,某个目标服务挂了不影响其他服务的调用。
    • ServiesApiHelper.Post(ServiesTypes, ...) 的 HTTP 调用部分包裹熔断策略:连续失败达到阈值 → 熔断(Open),后续请求直接返回"熔断中"错误,不发起 HTTP 调用;熔断持续指定时长 → 半开(Half-Open),允许一次探测请求;探测成功 → 关闭熔断,恢复正常。
    • 只统计瞬时故障(HttpRequestException、TaskCanceledException、TimeoutException、OperationCanceledException、WebException),业务错误(code 错误、参数错误等)不计入熔断。
    • 新增 ExecuteHttpCall 私有方法,从 Post 中提取 HTTP 调用逻辑,便于熔断器包裹。
    • 添加 Polly 7.2.4 NuGet 依赖(兼容所有目标框架 net451+)。
  • 配置项(appsettings → AppSettings,均有默认值):
    • CircuitBreakerEnabled(默认 true):总开关,设为 false 可完全禁用熔断器。
    • CircuitBreakerFailureThreshold(默认 5):连续失败几次触发熔断。
    • CircuitBreakerDurationSeconds(默认 30):熔断持续多少秒后进入半开探测。
  • 影响范围:完全向后兼容——默认启用,行为合理;可通过配置关闭。所有通过 ServiesApiHelper.Post(ServiesTypes, ...) 调用的业务服务自动受保护,无需改代码。

V1.13.0

  • (修复静默成功):ServiesAPiExecutingProcesses.Run(...) 四个重载全部加 action == null 校验,null 时抛 ArgumentNullException。
    • 原因:旧实现 action?.Invoke() 让 null 静默返回"成功",掩盖调用方 bug(100 处调用点都有此隐患)。
    • 影响范围:破坏性——依赖 Run(null, ...) 静默返回成功的老代码会立刻抛 ArgumentNullException;实际调用点几乎不传 null,属罕见错误用法。
  • (DataValue 空判失败):Run<T>(...) 两个重载加 requireDataValue = false 参数;为 true 时若 DataValue == null 则 SetValue(false, "业务数据为空"),避免"Success=true 但 DataValue=null"导致下游 NRE。
    • 默认 false 保持老行为不变;新代码可显式传 true 增强校验。
  • 调用方从 1.12.x 平滑升级:只要不传 null action,行为完全一致。

V1.12.0

  • FileServiesAPI 新增 CreateToken:调用文件服务 POST /Upload/CreateToken 创建前端直传用的临时上传 token(载荷固化项目/目录,有效期由文件服务 UploadTokenExpireMinutes 配置,默认 20 分钟),返回 Token/Expire(毫秒时间戳)/HeaderName
  • 新增共享模型 UploadTokenResult(Models),与文件服务端共用同一契约

V1.11.0

  • 新增日志服务API(LogServiesAPI):站点日志/操作日志/数据操作日志的写入与查询,uid 由参数传入,走服务间签名调用 LogServies 的 OpenApi 接口
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net451 is compatible.  net452 was computed.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 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.16.0 47 10/30/2026
1.12.0 98 10/26/2026
1.11.0 136 10/23/2026
1.9.0 312 12/31/2025
1.8.0 321 9/1/2025
1.7.0 294 8/13/2025
1.6.0 244 7/29/2025
1.5.4 298 6/19/2025
1.5.3 311 4/18/2024
1.5.2 299 4/7/2024
1.5.0 275 10/12/2023
1.4.0 307 8/8/2023
1.3.0 323 8/5/2023
1.2.2 330 6/26/2023
1.2.1 722 7/14/2022
1.2.0 695 7/13/2022
1.1.4 688 7/8/2022
1.1.3 638 7/8/2022
1.1.2 656 7/7/2022
1.1.1 685 7/7/2022
Loading failed