.net最新框架,
项目信息
- Gitee:https://gitee.com/dotnetchina/Furion
- Github:https://github.com/MonkSoul/Furion
- 文档:https://dotnetchina.gitee.io/furion
本期亮点
1. Sql 高级代理支持 IEnumerable<T> 、T[] 和 Tuple<(IEnumerable<T>, T[], T, List<T> 混合返回值
public interface ISql : ISqlDispatchProxy { [SqlExecute("select * from person where id = @id"] Person GetPerson(int id; [SqlExecute("select * from person where id = @id"] Task<Person> GetPersonAsync(int id; // 异步 // ---------------------------------------- [SqlExecute("select * from person"] List<Person> GetPersons(; [SqlExecute("select * from person"] Task<List<Person>> GetPersonsAsync(; // 异步 // ---------------------------------------- [SqlExecute("select * from person"] Person[] GetPersons(; [SqlExecute("select * from person"] Task<Person[]> GetPersonsAsync(; // 异步 // ---------------------------------------- [SqlExecute("select * from person"] IEnumerable<Person> GetPersons2(; [SqlExecute("select * from person"] Task<IEnumerable<Person>> GetPersons2Async(; // 异步 // ---------------------------------------- // 更复杂的组合 [SqlExecute(@" select * from person where id = 1; select * from person; select * from person where id > 0; select * from person where id > 0; "] (Person, List<Person>, Person[], IEnumerable<Person> GetPersons(; // 更复杂的组合 [SqlExecute(@" select * from person where id = 1; select * from person; select * from person where id > 0; select * from person where id > 0; "] Task<(Person, List<Person>, Person[], IEnumerable<Person>> GetPersonsAsync(; // 异步 }
2. 定时任务支持 Http 作业
HTTP 请求作业通常用于定时请求/访问互联网地址。
services.AddSchedule(options => { options.AddHttpJob(request => { request.RequestUri = "https://www.chinadot.net"; request.HttpMedhod = HttpMethod.Get; // request.Body = "{}"; // 设置请求报文体 }, Triggers.PeriodSeconds(5; };
作业执行日志如下:
info: 2023-03-11 11:05:36.3616747 +08:00 星期六 L System.Logging.ScheduleService[0] #1 Schedule hosted service is running. info: 2023-03-11 11:05:36.3652411 +08:00 星期六 L System.Logging.ScheduleService[0] #1 Schedule hosted service is preloading... info: 2023-03-11 11:05:36.5172940 +08:00 星期六 L System.Logging.ScheduleService[0] #1 The <job1_trigger1> trigger for scheduler of <job1> successfully appended to the schedule. info: 2023-03-11 11:05:36.5189296 +08:00 星期六 L System.Logging.ScheduleService[0] #1 The scheduler of <job1> successfully appended to the schedule. warn: 2023-03-11 11:05:36.5347816 +08:00 星期六 L System.Logging.ScheduleService[0] #1 Schedule hosted service preload completed, and a total of <1> schedulers are appended. warn: 2023-03-11 11:05:41.5228138 +08:00 星期六 L System.Logging.ScheduleService[0] #15 Schedule hosted service will sleep <4970> milliseconds and be waked up at <2023-03-11 11:05:46.486>. info: 2023-03-11 11:05:41.5542865 +08:00 星期六 L System.Net.Http.HttpClient.HttpJob.LogicalHandler[100] #9 Start processing HTTP request GET https://www.chinadot.net/ info: 2023-03-11 11:05:41.5589056 +08:00 星期六 L System.Net.Http.HttpClient.HttpJob.ClientHandler[100] #9 Sending HTTP request GET https://www.chinadot.net/ info: 2023-03-11 11:05:44.1305461 +08:00 星期六 L System.Net.Http.HttpClient.HttpJob.ClientHandler[101] #8 Received HTTP response headers after 2566.7836ms - 200 info: 2023-03-11 11:05:44.1343977 +08:00 星期六 L System.Net.Http.HttpClient.HttpJob.LogicalHandler[101] #8 End processing HTTP request after 2584.2327ms - 200 info: 2023-03-11 11:05:48.6475959 +08:00 星期六 L System.Logging.ScheduleService[0] #4 Received HTTP response body with a length of <63639> output as follows - 200 <!DOCTYPE html><html><head> <title>dotNET China | 让 .NET 开发更简单,更通用,更流行</title> ...... </body></html>
本期更新
- [新增] 定时任务 HTTP 作业,支持定时请求互联网 URL 地址 4.8.7.7 ⏱️2023.03.11 01d4466
- [新增] 定时任务作业触发器 Trigger 执行结果 Result 和执行耗时 ElapsedTime 属性 4.8.7.7 ⏱️2023.03.11 01d4466
- [新增] 定时任务作业看板支持查看作业触发器执行结果 Result 和执行耗时 ElapsedTime 属性 4.8.7.7 ⏱️2023.03.11 01d4466
- [新增] 定时任务休眠时长和唤醒时机日志输出 4.8.7.6 ⏱️2023.03.08版本号Sql 高级拦截支持返回 IEnumerable<T> 和 T[] 类型值 4.8.7.5 ⏱️2023.03.07 f2ca2d3
- [新增] .m3u8 和 .ts 文件类型 MIME 支持 4.8.7.5 ⏱️2023.03.07版本号LoggingMonitor 支持对参数贴 [SuppressMonitor] 特性跳过记录 4.8.7.3 ⏱️2023.03.01版本号LoggingMonitor 监听 TraceId、ThreadId、Accept-Language 4.8.7.1 ⏱️2023.02.27 df35201
- [新增] 规范化结果 UnifyContext.GetSerializerSettings(string 静态方法 4.8.7.1 ⏱️2023.02.27版本号适配 .NET8 Preview.1 4.8.7 ⏱️2023.02.22
- [升级] 脚手架支持创建 .NET8 Preview.1 项目 4.8.7 ⏱️2023.02.22
-
问题修复
- [修复] 定时任务服务在停止进程时会卡住 30秒 问题 4.8.7.8 ⏱️2023.03.13版本号#I6MHOU
- [修复] 定时任务看板删除不存在的作业触发器出现空异常 4.8.7.7 ⏱️2023.03.11 01d4466
- [修复] 日志消息没有处理 \n 换行符对齐问题 4.8.7.6 ⏱️2023.03.10 759bcc5
- [修复] 审计日志 LoggingMonitor 对特定参数贴有 [FromServices] 特性依旧记录问题 4.8.7.3 ⏱️2023.03.01 17b134e
- [修复] Swagger 接口排序同时指定 Tag 和 Order 之后无效 4.8.7.2 ⏱️2023.03.01版本号#I6IP66
新特性
其他更改
- [调整] 定时任务查看作业触发器运行记录由保存 10条 改为 5条 4.8.7.7 ⏱️2023.03.07 01d4466
文档
- [新增] ASP.NET 8 集成 文档
贡献者
- kingling (@kinglinglive !732 !729