登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情
代码拉取完成,页面将自动刷新
开源项目
>
WEB应用开发
>
Web开发框架
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
9.9K
Star
14.5K
Fork
4.2K
GVP
dotNET China
/
Furion
代码
Issues
0
Pull Requests
0
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
📝 发布 Furion v4.6.5 版本
已完成
#I5VPD1
百小僧
拥有者
创建于
2022-10-14 13:10
### 功能描述 发布 `Furion` 和 `Furion.Tools` 和 `Furion.Xunit` `v4.6.5` 版本 包含以下功能更新: ### 功能清单 - [x] 新增 **`long` 序列化丢精度的 `JsonConvert` 内置转换器,`.AddLongTypeConverters()`** <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 新增 `app.EnableBuffering()` 拓展,解决 `Request.Body` 不能重复读问题 <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 移除 ~~`DateOnlyJsonConverter` 和 `DateOnlyOffsetJsonConverter` 处理~~ <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 调整 **~~`.AddDateFormatString()`~~ 名称为 `.AddDateTimeTypeConverters()`** <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 修复 `.ToDictionary()` 拓展不支持 `JObject` 类型问题 <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [a11bf8d](https://github.com/MonkSoul/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6) - [x] 修复 `LoggingMonitor` 处理 `long` 类型丢精度问题 <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 内置 `Microsoft.AspNetCore.Mvc.NewtonsoftJson` 拓展,原因是太多人使用了 <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 升级 `SqlSugar` 拓展包和脚手架至 `5.1.3.27` 版本 - [x] 发布 `v4.6.5` 版本文档 - [x] 更新示例项目 `samples` 依赖至 `v4.6.5` 版本 - [x] [Replit](https://replit.com/) 网站 `Furion` 案例同步到 `v4.6.5` 版本 - [x] `Gitee` 和 `Github` 发布 `Release-v4.6.5` 版本 - [x] 同步更新日志 ### 代码实现 [https://gitee.com/dotnetchina/Furion/pulls/622](https://gitee.com/dotnetchina/Furion/pulls/622) [https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) [https://gitee.com/dotnetchina/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6](https://gitee.com/dotnetchina/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6) ### 文档更新 1. **内置 `long` 序列化丢精度处理** 有时候我们需要将 ` long` 类型序列化时转为 `string` 类型,防止 `JavaScript` 出现精度溢出问题,这个时候可以尝试使用以下方法解决: - `System.Text.Json` 方式 ```cs showLineNumbers {2,4} services.AddControllersWithViews() .AddJsonOptions(options => { options.JsonSerializerOptions.Converters.AddLongTypeConverters(); }); ``` - `Newtonsoft.Json` 方式 ```cs showLineNumbers {3} .AddNewtonsoftJson(options => { options.SerializerSettings.Converters.AddLongTypeConverters(); }) ``` ----- 2. **关于 `Dictionary<,>` 类型包含 `long` 处理** 默认情况下,`System.Text.Json` 不支持 `Dictionary<,>` 类型的序列化设置 `Converter` 操作,这个时候可以换成 `Newtonsoft.Json` 处理,如: ```cs showLineNumbers {3} .AddNewtonsoftJson(options => { options.SerializerSettings.Converters.AddLongTypeConverters(); }) ``` 同时创建 `NewtonsoftJsonSerializerProvider.cs` 文件写入即可: ```cs showLineNumbers namespace YourProject.Core; public class NewtonsoftJsonSerializerProvider : IJsonSerializerProvider, ISingleton { public string Serialize(object value, object jsonSerializerOptions = null) { return JsonConvert.SerializeObject(value, (jsonSerializerOptions ?? GetSerializerOptions()) as JsonSerializerSettings); } public T Deserialize<T>(string json, object jsonSerializerOptions = null) { return JsonConvert.DeserializeObject<T>(json, (jsonSerializerOptions ?? GetSerializerOptions()) as JsonSerializerSettings); } public object GetSerializerOptions() { return App.GetOptions<MvcNewtonsoftJsonOptions>()?.SerializerSettings; } } ```
### 功能描述 发布 `Furion` 和 `Furion.Tools` 和 `Furion.Xunit` `v4.6.5` 版本 包含以下功能更新: ### 功能清单 - [x] 新增 **`long` 序列化丢精度的 `JsonConvert` 内置转换器,`.AddLongTypeConverters()`** <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 新增 `app.EnableBuffering()` 拓展,解决 `Request.Body` 不能重复读问题 <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 移除 ~~`DateOnlyJsonConverter` 和 `DateOnlyOffsetJsonConverter` 处理~~ <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 调整 **~~`.AddDateFormatString()`~~ 名称为 `.AddDateTimeTypeConverters()`** <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 修复 `.ToDictionary()` 拓展不支持 `JObject` 类型问题 <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [a11bf8d](https://github.com/MonkSoul/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6) - [x] 修复 `LoggingMonitor` 处理 `long` 类型丢精度问题 <sup>4.6.5</sup> [#I5VJHC](https://gitee.com/dotnetchina/Furion/issues/I5VJHC) [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 内置 `Microsoft.AspNetCore.Mvc.NewtonsoftJson` 拓展,原因是太多人使用了 <sup>4.6.5</sup> [aded58d](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) - [x] 升级 `SqlSugar` 拓展包和脚手架至 `5.1.3.27` 版本 - [x] 发布 `v4.6.5` 版本文档 - [x] 更新示例项目 `samples` 依赖至 `v4.6.5` 版本 - [x] [Replit](https://replit.com/) 网站 `Furion` 案例同步到 `v4.6.5` 版本 - [x] `Gitee` 和 `Github` 发布 `Release-v4.6.5` 版本 - [x] 同步更新日志 ### 代码实现 [https://gitee.com/dotnetchina/Furion/pulls/622](https://gitee.com/dotnetchina/Furion/pulls/622) [https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c](https://gitee.com/dotnetchina/Furion/commit/aded58d0bc587d1a1844382c66ec1ab3de96be7c) [https://gitee.com/dotnetchina/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6](https://gitee.com/dotnetchina/Furion/commit/a11bf8d8b6bb90b41b8394d8bca35aa3539239e6) ### 文档更新 1. **内置 `long` 序列化丢精度处理** 有时候我们需要将 ` long` 类型序列化时转为 `string` 类型,防止 `JavaScript` 出现精度溢出问题,这个时候可以尝试使用以下方法解决: - `System.Text.Json` 方式 ```cs showLineNumbers {2,4} services.AddControllersWithViews() .AddJsonOptions(options => { options.JsonSerializerOptions.Converters.AddLongTypeConverters(); }); ``` - `Newtonsoft.Json` 方式 ```cs showLineNumbers {3} .AddNewtonsoftJson(options => { options.SerializerSettings.Converters.AddLongTypeConverters(); }) ``` ----- 2. **关于 `Dictionary<,>` 类型包含 `long` 处理** 默认情况下,`System.Text.Json` 不支持 `Dictionary<,>` 类型的序列化设置 `Converter` 操作,这个时候可以换成 `Newtonsoft.Json` 处理,如: ```cs showLineNumbers {3} .AddNewtonsoftJson(options => { options.SerializerSettings.Converters.AddLongTypeConverters(); }) ``` 同时创建 `NewtonsoftJsonSerializerProvider.cs` 文件写入即可: ```cs showLineNumbers namespace YourProject.Core; public class NewtonsoftJsonSerializerProvider : IJsonSerializerProvider, ISingleton { public string Serialize(object value, object jsonSerializerOptions = null) { return JsonConvert.SerializeObject(value, (jsonSerializerOptions ?? GetSerializerOptions()) as JsonSerializerSettings); } public T Deserialize<T>(string json, object jsonSerializerOptions = null) { return JsonConvert.DeserializeObject<T>(json, (jsonSerializerOptions ?? GetSerializerOptions()) as JsonSerializerSettings); } public object GetSerializerOptions() { return App.GetOptions<MvcNewtonsoftJsonOptions>()?.SerializerSettings; } } ```
评论 (
5
)
登录
后才可以发表评论
状态
已完成
待办的
进行中
已完成
已关闭
负责人
未设置
百小僧
monksoul
负责人
协作者
+负责人
+协作者
标签
优化
新功能
重大调整
漏洞
未设置
标签管理
里程碑
v4.6.5
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
C#
1
https://gitee.com/dotnetchina/Furion.git
git@gitee.com:dotnetchina/Furion.git
dotnetchina
Furion
Furion
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册