Skip to content

Commit 8015f9f

Browse files
committed
feat: add blazor sample template
1 parent f3f83de commit 8015f9f

26 files changed

+677
-19
lines changed

Cnblogs.DashScope.Sdk.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cnblogs.DashScope.AI.UnitTe
2424
EndProject
2525
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cnblogs.DashScope.Tests.Shared", "test\Cnblogs.DashScope.Tests.Shared\Cnblogs.DashScope.Tests.Shared.csproj", "{06F0AF23-445B-4C6F-9E19-570DA9B7435D}"
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cnblogs.DashScope.WebSample", "sample\Cnblogs.DashScope.WebSample\Cnblogs.DashScope.WebSample.csproj", "{A3BC8B2D-BE81-4614-963B-9313F74D89B4}"
28+
EndProject
29+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cnblogs.DashScope.WebSample.Client", "sample\Cnblogs.DashScope.WebSample.Client\Cnblogs.DashScope.WebSample.Client.csproj", "{FA6E73D6-32C4-453A-88C5-00E1AFFE1397}"
30+
EndProject
2731
Global
2832
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2933
Debug|Any CPU = Debug|Any CPU
@@ -37,6 +41,8 @@ Global
3741
{CC389455-A3EA-4F09-B524-4DC351A1E1AA} = {008988ED-0A3B-4272-BCC3-7B4110699345}
3842
{5088DE77-1CE3-46FB-B9D0-27A6C9A5EED1} = {CFC8ECB3-5248-46CD-A56C-EC088F2A3804}
3943
{5D5AD75A-8084-4738-AC56-B8A23E649452} = {008988ED-0A3B-4272-BCC3-7B4110699345}
44+
{A3BC8B2D-BE81-4614-963B-9313F74D89B4} = {2E15D1EC-4A07-416E-8BE6-D907F509FD35}
45+
{FA6E73D6-32C4-453A-88C5-00E1AFFE1397} = {2E15D1EC-4A07-416E-8BE6-D907F509FD35}
4046
{25EE79E1-147B-42FD-AFEA-E1550EDD1D36} = {CFC8ECB3-5248-46CD-A56C-EC088F2A3804}
4147
{06F0AF23-445B-4C6F-9E19-570DA9B7435D} = {CFC8ECB3-5248-46CD-A56C-EC088F2A3804}
4248
EndGlobalSection
@@ -69,6 +75,14 @@ Global
6975
{5D5AD75A-8084-4738-AC56-B8A23E649452}.Debug|Any CPU.Build.0 = Debug|Any CPU
7076
{5D5AD75A-8084-4738-AC56-B8A23E649452}.Release|Any CPU.ActiveCfg = Release|Any CPU
7177
{5D5AD75A-8084-4738-AC56-B8A23E649452}.Release|Any CPU.Build.0 = Release|Any CPU
78+
{A3BC8B2D-BE81-4614-963B-9313F74D89B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
79+
{A3BC8B2D-BE81-4614-963B-9313F74D89B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
80+
{A3BC8B2D-BE81-4614-963B-9313F74D89B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
81+
{A3BC8B2D-BE81-4614-963B-9313F74D89B4}.Release|Any CPU.Build.0 = Release|Any CPU
82+
{FA6E73D6-32C4-453A-88C5-00E1AFFE1397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
83+
{FA6E73D6-32C4-453A-88C5-00E1AFFE1397}.Debug|Any CPU.Build.0 = Debug|Any CPU
84+
{FA6E73D6-32C4-453A-88C5-00E1AFFE1397}.Release|Any CPU.ActiveCfg = Release|Any CPU
85+
{FA6E73D6-32C4-453A-88C5-00E1AFFE1397}.Release|Any CPU.Build.0 = Release|Any CPU
7286
{25EE79E1-147B-42FD-AFEA-E1550EDD1D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
7387
{25EE79E1-147B-42FD-AFEA-E1550EDD1D36}.Debug|Any CPU.Build.0 = Debug|Any CPU
7488
{25EE79E1-147B-42FD-AFEA-E1550EDD1D36}.Release|Any CPU.ActiveCfg = Release|Any CPU
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
<IsPackable>false</IsPackable>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<IsPackable>false</IsPackable>
9+
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<ProjectReference Include="..\..\src\Cnblogs.DashScope.Sdk\Cnblogs.DashScope.Sdk.csproj" />
13-
<ProjectReference Include="..\..\src\Cnblogs.DashScope.AI\Cnblogs.DashScope.AI.csproj" />
14-
</ItemGroup>
11+
<ItemGroup>
12+
<ProjectReference Include="..\..\src\Cnblogs.DashScope.Sdk\Cnblogs.DashScope.Sdk.csproj"/>
13+
<ProjectReference Include="..\..\src\Cnblogs.DashScope.AI\Cnblogs.DashScope.AI.csproj"/>
14+
</ItemGroup>
1515

16-
<ItemGroup>
17-
<None Update="test.txt">
18-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19-
</None>
20-
</ItemGroup>
16+
<ItemGroup>
17+
<None Update="test.txt">
18+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19+
</None>
20+
</ItemGroup>
2121

22-
<ItemGroup>
23-
<PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
24-
</ItemGroup>
22+
<ItemGroup>
23+
<PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0"/>
24+
</ItemGroup>
2525

2626
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
8+
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
9+
<IsPackable>false</IsPackable>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.16"/>
14+
</ItemGroup>
15+
16+
</Project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@page "/counter"
2+
@rendermode InteractiveAuto
3+
4+
<PageTitle>Counter</PageTitle>
5+
6+
<h1>Counter</h1>
7+
8+
<p role="status">Current count: @currentCount</p>
9+
10+
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
11+
12+
@code {
13+
private int currentCount = 0;
14+
15+
private void IncrementCount()
16+
{
17+
currentCount++;
18+
}
19+
20+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
3+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
4+
5+
await builder.Build().RunAsync();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@using System.Net.Http
2+
@using System.Net.Http.Json
3+
@using Microsoft.AspNetCore.Components.Forms
4+
@using Microsoft.AspNetCore.Components.Routing
5+
@using Microsoft.AspNetCore.Components.Web
6+
@using static Microsoft.AspNetCore.Components.Web.RenderMode
7+
@using Microsoft.AspNetCore.Components.Web.Virtualization
8+
@using Microsoft.JSInterop
9+
@using Cnblogs.DashScope.WebSample.Client
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\..\src\Cnblogs.DashScope.AI\Cnblogs.DashScope.AI.csproj" />
12+
<ProjectReference Include="..\..\src\Cnblogs.DashScope.AspNetCore\Cnblogs.DashScope.AspNetCore.csproj" />
13+
<ProjectReference Include="..\Cnblogs.DashScope.WebSample.Client\Cnblogs.DashScope.WebSample.Client.csproj"/>
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.16"/>
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<_ContentIncludedByDefault Remove="Cnblogs.DashScope.WebSample\obj\Cnblogs.DashScope.WebSample.csproj.nuget.dgspec.json" />
19+
<_ContentIncludedByDefault Remove="Cnblogs.DashScope.WebSample\obj\project.assets.json" />
20+
<_ContentIncludedByDefault Remove="wwwroot\tailwind.min.js" />
21+
</ItemGroup>
22+
23+
</Project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8"/>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7+
<base href="/"/>
8+
<script src="tailwind.min.js"></script>
9+
<link rel="stylesheet" href="app.css"/>
10+
<link rel="stylesheet" href="Cnblogs.DashScope.WebSample.styles.css"/>
11+
<link rel="icon" type="image/png" href="favicon.png"/>
12+
<HeadOutlet/>
13+
</head>
14+
15+
<body>
16+
<Routes/>
17+
<script src="_framework/blazor.web.js"></script>
18+
</body>
19+
20+
</html>

0 commit comments

Comments
 (0)