Skip to content

Commit

Permalink
1.4.1 released
Browse files Browse the repository at this point in the history
  • Loading branch information
vipwan committed Dec 8, 2023
1 parent a100d49 commit 6ff048c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Biwen.QuickApi/Biwen.QuickApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<PackageVersion>1.4.0.0</PackageVersion>
<PackageVersion>1.4.1.0</PackageVersion>

<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
Expand All @@ -20,8 +20,8 @@
<PackageTags>webapi;minimal;api;endpoint;REPR;netcore</PackageTags>
<PackageReleaseNotes>NET8 and NSwag14 support</PackageReleaseNotes>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<AssemblyVersion>1.4.0</AssemblyVersion>
<FileVersion>1.4.0</FileVersion>
<AssemblyVersion>1.4.1</AssemblyVersion>
<FileVersion>1.4.1</FileVersion>

</PropertyGroup>

Expand All @@ -31,11 +31,11 @@

<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="C:\Users\vipwa\source\repos\Biwen.QuickApi\README.md" Link="README.md">
<None Include="..\..\Biwen.QuickApi\README.md" Link="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="C:\Users\vipwa\source\repos\Biwen.QuickApi\LICENSE.txt" Link="LICENSE.txt">
<None Include="..\..\Biwen.QuickApi\LICENSE.txt" Link="LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public class MyStore
[QuickApi("todos")]
public class TodosApi : BaseQuickApi
{
public override Task<IResultResponse> ExecuteAsync(EmptyRequest request)
public override ValueTask<IResultResponse> ExecuteAsync(EmptyRequest request)
{
return Task.FromResult(IResultResponse.OK(MyStore.SampleTodos()));
return new ValueTask<IResultResponse>(IResultResponse.OK(MyStore.SampleTodos()));
}
}
```
Expand Down Expand Up @@ -135,7 +135,7 @@ public class FromBodyRequest : BaseRequest<FromBodyRequest>
/// </summary>
public class CustomApiRequestBinder : IReqBinder<CustomApiRequest>
{
public async Task<CustomApiRequest> BindAsync(HttpContext context)
public async ValueTask<CustomApiRequest> BindAsync(HttpContext context)
{
var request = new CustomApiRequest
{
Expand Down Expand Up @@ -207,7 +207,7 @@ public class CustomApi : BaseQuickApi<CustomApiRequest>
UseReqBinder<CustomApiRequestBinder>();
}

public override async Task<EmptyResponse> ExecuteAsync(CustomApiRequest request)
public override async ValueTask<EmptyResponse> ExecuteAsync(CustomApiRequest request)
{
await Task.CompletedTask;
Console.WriteLine($"获取自定义的 CustomApi:,从querystring:c绑定,{request.Name}");
Expand Down Expand Up @@ -250,9 +250,9 @@ public class CustomApi : BaseQuickApi<CustomApiRequest>
[QuickApi("iresult", Verbs = Verb.GET)]
public class IResultTestApi : BaseQuickApiWithoutRequest<IResultResponse>
{
public override async Task<IResultResponse> ExecuteAsync(EmptyRequest request)
public override async ValueTask<IResultResponse> ExecuteAsync(EmptyRequest request)
{
return Results.Ok("Hello World IResult!").AsRsp();
return new ValueTask<IResultResponse>(Results.Ok("Hello World IResult!").AsRsp());
}

public override RouteHandlerBuilder HandlerBuilder(RouteHandlerBuilder builder)
Expand All @@ -272,7 +272,7 @@ public class IResultTestApi : BaseQuickApiWithoutRequest<IResultResponse>
[QuickApiSummary("上传文件测试", "上传文件测试")]
public class FromFileApi : BaseQuickApi<FileUploadRequest, IResultResponse>
{
public override async Task<IResultResponse> ExecuteAsync(FileUploadRequest request)
public override async ValueTask<IResultResponse> ExecuteAsync(FileUploadRequest request)
{
//测试上传一个文本文件并读取内容
if (request.File != null)
Expand All @@ -283,7 +283,7 @@ public class FromFileApi : BaseQuickApi<FileUploadRequest, IResultResponse>
return Results.Ok(content).AsRspOfResult();
}
}
return Results.BadRequest("no file").AsRspOfResult();
return new ValueTask<IResultResponse>(Results.BadRequest("no file").AsRspOfResult());
}
}

Expand All @@ -293,9 +293,9 @@ public class FromFileApi : BaseQuickApi<FileUploadRequest, IResultResponse>
[QuickApi(""), JustAsService]
public class JustAsService : BaseQuickApi<EmptyRequest, ContentResponse>
{
public override Task<ContentResponse> ExecuteAsync(EmptyRequest request)
public override ValueTask<ContentResponse> ExecuteAsync(EmptyRequest request)
{
return Task.FromResult(new ContentResponse("Hello World JustAsService!"));
return new ValueTask<ContentResponse>(new ContentResponse("Hello World JustAsService!"));
}
}
```
Expand Down

0 comments on commit 6ff048c

Please sign in to comment.