XYS 2.3.2
dotnet add package XYS --version 2.3.2
NuGet\Install-Package XYS -Version 2.3.2
<PackageReference Include="XYS" Version="2.3.2" />
<PackageVersion Include="XYS" Version="2.3.2" />
<PackageReference Include="XYS" />
paket add XYS --version 2.3.2
#r "nuget: XYS, 2.3.2"
#:package XYS@2.3.2
#addin nuget:?package=XYS&version=2.3.2
#tool nuget:?package=XYS&version=2.3.2
XYS
根核心基础类库(零第三方依赖),提供系统级请求/响应契约、领域数据与报告标记接口、线程安全单例基类及实体映射特性,供解决方案内各业务域与工具库统一引用。
目标框架
net8.0 · net462 · netcoreapp3.1 · netstandard2.0 · netstandard2.1
依赖
无外部 NuGet 依赖。
核心类型说明
1. 请求与响应契约(XYS)
| 类型 | 说明 |
|---|---|
IReq |
请求基础接口,约定请求唯一标识 ReqId |
BaseReq |
通用 JSON 透传请求报文(ReqId + JsonIn) |
BaseRes |
通用 JSON 透传响应报文(ReqId + Code + Msg + JsonOut) |
IResult |
处理结果顶层标记接口 |
Result |
通用处理结果基类(Code + Message) |
SendResult |
继承自 Result,补充请求追踪标识 ReqId,广泛用于消息/HTTP 调用返回 |
ISignParam |
(已标记 [Obsolete]) 早期签名参数契约;注意历史属性 TimeSpan 实际语义为请求时间戳(Timestamp) |
状态码约定说明:
SendResult/Result:在HttpJsonUtil与XYS.Message.*体系中通常以"OK"表示成功、"ERR"表示异常。BaseRes:历史透传网关约定"1"表示成功、"-1"表示业务异常;HttpJsonUtil.Post(url, BaseReq)在通信或空响应异常时兜底赋值为"error"。
2. 数据与报告接口(XYS)
IData— 领域数据对象顶层标记接口(由IHisData、IExamData、ICard、IWorkData等继承)。IReport— 具备唯一字符串标识ID的报告或数据模型接口。
3. 实体映射与界面特性(XYS.Attributes)
所有特性均声明为 sealed 且 AllowMultiple = false, Inherited = true(支持派生类继承属性上的标注):
DBColAttribute— 标注实体属性对应的数据库列名或源对象属性名(配合XYS.Utils.Sys中的DBUtil.Convert/DeConvert使用;Name留空时默认取宿主属性名)。UIDisplayAttribute— 界面显示标记特性(可标注于属性、字段或类)。UIExportAttribute— 界面导出列配置特性(IsExport默认true,支持指定DispName与ExportOrder)。UIModelAttribute— 界面模型属性对照特性(IsMap默认true,支持指定源属性名SrcName)。
4. 单例基类(XYS)
BaseSingle<T>— 基于Lazy<T>(ExecutionAndPublication)实现的线程安全延迟加载泛型单例基类。⚠️ 受
where T : class, new()约束限制,派生类必须公开无参构造函数。新代码已标记[Obsolete]提示,建议优先采用依赖注入容器管理单例,或在类型内部通过private构造函数配合静态Lazy<T>实现严格单例。
版本
当前版本 2.3.2。
2.3.2 变更
- 修复
BaseSingle<T>双重检查锁定缺少volatile的潜在内存可见性并发缺陷,内部改用线程安全的Lazy<T>实现,保持公开与受保护成员签名完全向后兼容。 - 为
DBColAttribute、UIDisplayAttribute、UIExportAttribute、UIModelAttribute补齐显式[AttributeUsage]约束与sealed修饰。 - 为
BaseSingle<T>与ISignParam补充非阻断[Obsolete]演进提示。 - 补全所有公开类型与成员的中文 XML 文档注释,开启
<GenerateDocumentationFile>true</GenerateDocumentationFile>。 - 移除已损坏的遗留工程文件
XYS.Net462.csproj。
| Product | Versions 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.6.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (15)
Showing the top 5 NuGet packages that depend on XYS:
| Package | Downloads |
|---|---|
|
XYS.Utils.Sys
系统级通用工具类库:提供 HTTP/JSON 与表单调用、配置读取与敏感项加解密(Crypto)、文件与路径、安全类型转换、反射、XML、SMTP 同步/异步邮件、CSV 导出,并完整承接数据库实体映射与 SQL 辅助(DBUtil、DBHelper、DBParse、NConvert、SqlUtil 等)。 |
|
|
XYS.Utils.DB
Package Description |
|
|
XYS.Lab
Package Description |
|
|
XYS.His
Package Description |
|
|
XYS.Worker
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.2 | 127 | 11/29/2026 |
| 2.3.1 | 1,282 | 7/14/2026 |
| 2.1.0.10 | 338 | 1/5/2026 |
| 2.1.0.9 | 520 | 4/21/2024 |
| 2.1.0.8 | 350 | 4/21/2024 |
| 2.1.0.7 | 3,514 | 10/10/2022 |
| 2.1.0.6 | 634 | 9/13/2022 |
| 2.1.0.5 | 650 | 8/29/2022 |
| 2.1.0.4 | 9,816 | 5/7/2022 |
| 2.1.0.3 | 641 | 5/7/2022 |
| 2.1.0.2 | 2,525 | 5/7/2022 |
| 2.1.0.1 | 2,810 | 1/23/2022 |
| 2.0.2.1 | 1,679 | 12/21/2021 |
| 2.0.1.2 | 3,374 | 12/20/2021 |
| 2.0.1.1 | 20,356 | 4/22/2021 |
| 2.0.0.1 | 879 | 4/22/2021 |
| 1.0.2.3 | 676 | 10/15/2020 |
| 1.0.2.2 | 655 | 10/15/2020 |
| 1.0.2.1 | 631 | 10/15/2020 |
| 1.0.1.1 | 1,105 | 5/25/2020 |