-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
3,316 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
framework/Furion.Pure/V5_Experience/Core/Extensions/Utf8JsonReaderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// ------------------------------------------------------------------------ | ||
// 版权信息 | ||
// 版权归百小僧及百签科技(广东)有限公司所有。 | ||
// 所有权利保留。 | ||
// 官方网站:https://baiqian.com | ||
// | ||
// 许可证信息 | ||
// Furion 项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。 | ||
// 许可证的完整文本可以在源代码树根目录中的 LICENSE-APACHE 和 LICENSE-MIT 文件中找到。 | ||
// 官方网站:https://furion.net | ||
// | ||
// 使用条款 | ||
// 使用本代码应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 免责声明 | ||
// 对于因使用本代码而产生的任何直接、间接、偶然、特殊或后果性损害,我们不承担任何责任。 | ||
// | ||
// 其他重要信息 | ||
// Furion 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。 | ||
// 有关 Furion 项目的其他详细信息,请参阅位于源代码树根目录中的 COPYRIGHT 和 DISCLAIMER 文件。 | ||
// | ||
// 更多信息 | ||
// 请访问 https://gitee.com/dotnetchina/Furion 获取更多关于 Furion 项目的许可证和版权信息。 | ||
// ------------------------------------------------------------------------ | ||
|
||
using System.Text.Json; | ||
|
||
namespace Furion.Extensions; | ||
|
||
/// <summary> | ||
/// <see cref="Utf8JsonReader" /> 拓展类 | ||
/// </summary> | ||
internal static class Utf8JsonReaderExtensions | ||
{ | ||
/// <summary> | ||
/// 获取 JSON 原始输入数据 | ||
/// </summary> | ||
/// <param name="reader"> | ||
/// <see cref="Utf8JsonReader" /> | ||
/// </param> | ||
/// <returns> | ||
/// <see cref="string" /> | ||
/// </returns> | ||
internal static string GetRawText(this ref Utf8JsonReader reader) | ||
{ | ||
// 将 Utf8JsonReader 转换为 JsonDocument | ||
using var jsonDocument = JsonDocument.ParseValue(ref reader); | ||
|
||
return jsonDocument.RootElement.Clone().GetRawText(); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
framework/Furion.Pure/V5_Experience/Shapeless/Constants/ClayType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// ------------------------------------------------------------------------ | ||
// 版权信息 | ||
// 版权归百小僧及百签科技(广东)有限公司所有。 | ||
// 所有权利保留。 | ||
// 官方网站:https://baiqian.com | ||
// | ||
// 许可证信息 | ||
// Furion 项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。 | ||
// 许可证的完整文本可以在源代码树根目录中的 LICENSE-APACHE 和 LICENSE-MIT 文件中找到。 | ||
// 官方网站:https://furion.net | ||
// | ||
// 使用条款 | ||
// 使用本代码应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 免责声明 | ||
// 对于因使用本代码而产生的任何直接、间接、偶然、特殊或后果性损害,我们不承担任何责任。 | ||
// | ||
// 其他重要信息 | ||
// Furion 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。 | ||
// 有关 Furion 项目的其他详细信息,请参阅位于源代码树根目录中的 COPYRIGHT 和 DISCLAIMER 文件。 | ||
// | ||
// 更多信息 | ||
// 请访问 https://gitee.com/dotnetchina/Furion 获取更多关于 Furion 项目的许可证和版权信息。 | ||
// ------------------------------------------------------------------------ | ||
|
||
namespace Furion.Shapeless; | ||
|
||
/// <summary> | ||
/// 流变对象的基本类型 | ||
/// </summary> | ||
/// <remarks>用于区分是单一对象还是集合(数组)形式。</remarks> | ||
public enum ClayType | ||
{ | ||
/// <summary> | ||
/// 单一对象 | ||
/// </summary> | ||
/// <remarks>缺省值。</remarks> | ||
Object = 0, | ||
|
||
/// <summary> | ||
/// 集合(数组)形式 | ||
/// </summary> | ||
Array | ||
} |
43 changes: 43 additions & 0 deletions
43
framework/Furion.Pure/V5_Experience/Shapeless/Converters/Json/ClayJsonConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// ------------------------------------------------------------------------ | ||
// 版权信息 | ||
// 版权归百小僧及百签科技(广东)有限公司所有。 | ||
// 所有权利保留。 | ||
// 官方网站:https://baiqian.com | ||
// | ||
// 许可证信息 | ||
// Furion 项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。 | ||
// 许可证的完整文本可以在源代码树根目录中的 LICENSE-APACHE 和 LICENSE-MIT 文件中找到。 | ||
// 官方网站:https://furion.net | ||
// | ||
// 使用条款 | ||
// 使用本代码应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 免责声明 | ||
// 对于因使用本代码而产生的任何直接、间接、偶然、特殊或后果性损害,我们不承担任何责任。 | ||
// | ||
// 其他重要信息 | ||
// Furion 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。 | ||
// 有关 Furion 项目的其他详细信息,请参阅位于源代码树根目录中的 COPYRIGHT 和 DISCLAIMER 文件。 | ||
// | ||
// 更多信息 | ||
// 请访问 https://gitee.com/dotnetchina/Furion 获取更多关于 Furion 项目的许可证和版权信息。 | ||
// ------------------------------------------------------------------------ | ||
|
||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Furion.Shapeless; | ||
|
||
/// <summary> | ||
/// <see cref="Clay" /> JSON 序列化转换器 | ||
/// </summary> | ||
public sealed class ClayJsonConverter : JsonConverter<Clay> | ||
{ | ||
/// <inheritdoc /> | ||
public override Clay? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => | ||
Clay.Parse(ref reader, new ClayOptions { JsonSerializerOptions = options }); | ||
|
||
/// <inheritdoc /> | ||
public override void Write(Utf8JsonWriter writer, Clay value, JsonSerializerOptions options) => | ||
writer.WriteRawValue(value.ToJsonString(options)); | ||
} |
37 changes: 37 additions & 0 deletions
37
framework/Furion.Pure/V5_Experience/Shapeless/Models/Utf8StringWriter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// ------------------------------------------------------------------------ | ||
// 版权信息 | ||
// 版权归百小僧及百签科技(广东)有限公司所有。 | ||
// 所有权利保留。 | ||
// 官方网站:https://baiqian.com | ||
// | ||
// 许可证信息 | ||
// Furion 项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。 | ||
// 许可证的完整文本可以在源代码树根目录中的 LICENSE-APACHE 和 LICENSE-MIT 文件中找到。 | ||
// 官方网站:https://furion.net | ||
// | ||
// 使用条款 | ||
// 使用本代码应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 免责声明 | ||
// 对于因使用本代码而产生的任何直接、间接、偶然、特殊或后果性损害,我们不承担任何责任。 | ||
// | ||
// 其他重要信息 | ||
// Furion 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。 | ||
// 有关 Furion 项目的其他详细信息,请参阅位于源代码树根目录中的 COPYRIGHT 和 DISCLAIMER 文件。 | ||
// | ||
// 更多信息 | ||
// 请访问 https://gitee.com/dotnetchina/Furion 获取更多关于 Furion 项目的许可证和版权信息。 | ||
// ------------------------------------------------------------------------ | ||
|
||
using System.Text; | ||
|
||
namespace Furion.Shapeless; | ||
|
||
/// <summary> | ||
/// <c>UTF-8</c> 格式的 <see cref="StringWriter" /> | ||
/// </summary> | ||
internal sealed class Utf8StringWriter : StringWriter | ||
{ | ||
/// <inheritdoc /> | ||
public override Encoding Encoding => Encoding.UTF8; | ||
} |
Oops, something went wrong.