feat: 实现 Blazor 前端界面 (Task 4.3) 和 CLI 工具 (Task 5.1)
Task 4.3 - Blazor 前端界面: - 创建 CodePlay.WebUI Blazor Server 项目 - 实现 Converter.razor 代码转换页面 - 提供代码输入、语言选择、转换按钮 - 显示转换结果、TODO 列表和问题列表 - 更新导航菜单 - 注册 ConversionService 服务 Task 5.1 - CLI 命令行工具: - 集成 System.CommandLine 库 - 实现 convert 命令(代码转换) - 实现 list 命令(列出支持的转换) - 实现 check 命令(检查是否支持) - 支持 -s/-t 指定源/目标语言 - 支持 -i/-o 指定输入/输出文件 - 支持 -v 指定验证轮次 - 支持 -c 指定配置文件 测试: - CLI help 命令: ✅ - CLI list 命令: ✅ - CLI convert 命令: ✅ (成功转换 C# 到 Java) Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using CodePlay.WebUI.Components;
|
||||
using CodePlay.Core.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
|
||||
// 注册核心转换服务
|
||||
builder.Services.AddSingleton<ConversionService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseAntiforgery();
|
||||
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode();
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user