From 6ff048c3692a3fd29aaa6adfc822baa36f7ff216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E9=9B=85=E8=99=8E?= Date: Fri, 8 Dec 2023 15:35:24 +0800 Subject: [PATCH] 1.4.1 released --- Biwen.QuickApi/Biwen.QuickApi.csproj | 10 +++++----- README.md | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Biwen.QuickApi/Biwen.QuickApi.csproj b/Biwen.QuickApi/Biwen.QuickApi.csproj index 7a543b6c..8a726921 100644 --- a/Biwen.QuickApi/Biwen.QuickApi.csproj +++ b/Biwen.QuickApi/Biwen.QuickApi.csproj @@ -6,7 +6,7 @@ latest enable true - 1.4.0.0 + 1.4.1.0 net7.0;net8.0 true @@ -20,8 +20,8 @@ webapi;minimal;api;endpoint;REPR;netcore NET8 and NSwag14 support LICENSE.txt - 1.4.0 - 1.4.0 + 1.4.1 + 1.4.1 @@ -31,11 +31,11 @@ - + True \ - + True \ diff --git a/README.md b/README.md index 6ca55ed8..dde633c2 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ public class MyStore [QuickApi("todos")] public class TodosApi : BaseQuickApi { - public override Task ExecuteAsync(EmptyRequest request) + public override ValueTask ExecuteAsync(EmptyRequest request) { - return Task.FromResult(IResultResponse.OK(MyStore.SampleTodos())); + return new ValueTask(IResultResponse.OK(MyStore.SampleTodos())); } } ``` @@ -135,7 +135,7 @@ public class FromBodyRequest : BaseRequest /// public class CustomApiRequestBinder : IReqBinder { - public async Task BindAsync(HttpContext context) + public async ValueTask BindAsync(HttpContext context) { var request = new CustomApiRequest { @@ -207,7 +207,7 @@ public class CustomApi : BaseQuickApi UseReqBinder(); } - public override async Task ExecuteAsync(CustomApiRequest request) + public override async ValueTask ExecuteAsync(CustomApiRequest request) { await Task.CompletedTask; Console.WriteLine($"获取自定义的 CustomApi:,从querystring:c绑定,{request.Name}"); @@ -250,9 +250,9 @@ public class CustomApi : BaseQuickApi [QuickApi("iresult", Verbs = Verb.GET)] public class IResultTestApi : BaseQuickApiWithoutRequest { - public override async Task ExecuteAsync(EmptyRequest request) + public override async ValueTask ExecuteAsync(EmptyRequest request) { - return Results.Ok("Hello World IResult!").AsRsp(); + return new ValueTask(Results.Ok("Hello World IResult!").AsRsp()); } public override RouteHandlerBuilder HandlerBuilder(RouteHandlerBuilder builder) @@ -272,7 +272,7 @@ public class IResultTestApi : BaseQuickApiWithoutRequest [QuickApiSummary("上传文件测试", "上传文件测试")] public class FromFileApi : BaseQuickApi { - public override async Task ExecuteAsync(FileUploadRequest request) + public override async ValueTask ExecuteAsync(FileUploadRequest request) { //测试上传一个文本文件并读取内容 if (request.File != null) @@ -283,7 +283,7 @@ public class FromFileApi : BaseQuickApi return Results.Ok(content).AsRspOfResult(); } } - return Results.BadRequest("no file").AsRspOfResult(); + return new ValueTask(Results.BadRequest("no file").AsRspOfResult()); } } @@ -293,9 +293,9 @@ public class FromFileApi : BaseQuickApi [QuickApi(""), JustAsService] public class JustAsService : BaseQuickApi { - public override Task ExecuteAsync(EmptyRequest request) + public override ValueTask ExecuteAsync(EmptyRequest request) { - return Task.FromResult(new ContentResponse("Hello World JustAsService!")); + return new ValueTask(new ContentResponse("Hello World JustAsService!")); } } ```