Skip to content

Commit 18be8bb

Browse files
authored
modify and add new test : CSharp/akazawayun.pro (#10017)
* add new test : CSharp/akazawayun.pro * modify config and code * add content-type * update url * update package version
1 parent cb0be72 commit 18be8bb

File tree

5 files changed

+99
-0
lines changed

5 files changed

+99
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AkazawaYun.PRO(https://akazawayun.cn/#akzLearning#%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 此阶段用于生成项目
2+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS publish
3+
WORKDIR /app
4+
COPY src .
5+
RUN dotnet publish -c Release -o /app/publish
6+
7+
# 此阶段用于运行
8+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS runtime
9+
WORKDIR /app
10+
COPY --from=publish /app/publish .
11+
12+
EXPOSE 2022
13+
ENTRYPOINT ["dotnet", "AkazawaYun.FrameworkBenchmarks.dll"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"framework": "akazawayun.pro",
3+
"tests": [
4+
{
5+
"default": {
6+
"display_name": "akazawayun.pro",
7+
"framework": "akazawayun.pro",
8+
"webserver": "akazawayun.pro",
9+
"plaintext_url": "/post/plaintext",
10+
"json_url": "/post/json",
11+
"port": 2022,
12+
"classification": "Micro",
13+
"approach": "Realistic",
14+
"platform": ".NET",
15+
"language": "C#",
16+
"flavor": "CoreCLR",
17+
"os": "Linux",
18+
"database_os": "Linux",
19+
"database": "MySQL",
20+
"orm": "Micro",
21+
"notes": ""
22+
}
23+
}
24+
]
25+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
11+
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
12+
<ServerGarbageCollection>true</ServerGarbageCollection>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="AkazawaYun.PRO" Version="1.13.25.727" />
17+
</ItemGroup>
18+
19+
</Project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using AkazawaYun.PRO7;
2+
using AkazawaYun.PRO7.AkazawaYunWebInterceptor;
3+
using System.Text.Json.Serialization;
4+
5+
namespace AkazawaYun.FrameworkBenchmarks;
6+
7+
public class Program : IPostFunction
8+
{
9+
static async Task Main()
10+
{
11+
akzJson.Config(null, Json.Default);
12+
var server = await akzWebBuilder.Shared.Load().SetDefault().Build()
13+
.Config<IWebReceptor, akzWebInterceptor>(itc =>
14+
{
15+
itc.AddInterceptor(new akzWebInterceptorNotOnlyPost());
16+
}).Launch();
17+
akzLog.Default = akzLog.Output.None;
18+
await Task.Delay(-1);
19+
}
20+
21+
22+
public static ValueTask<HttpRes> plaintext(HttpReq _)
23+
{
24+
return HttpRes.HttpOK("Hello, World!", ".txt");
25+
}
26+
public static ValueTask<HttpRes> json(HttpReq _)
27+
{
28+
return HttpRes.HttpJson(new JsonResponse
29+
{
30+
message = "Hello, World!"
31+
});
32+
}
33+
}
34+
35+
public class JsonResponse
36+
{
37+
public string? message { get; set; }
38+
}
39+
40+
[JsonSerializable(typeof(JsonResponse))]
41+
public partial class Json : JsonSerializerContext { }

0 commit comments

Comments
 (0)