feat: 完成 CodePlay 项目初始化和核心解析器实现

- 创建 CodePlay 解决方案和 4 个项目 (Core, Web, CLI, Tests)
- 实现核心数据模型 (ConversionRequest, ConversionResult, Project 等)
- 实现核心接口 (IParser, IConverter, ICodeGenerator 等)
- 实现基础抽象类 BaseParser
- 实现 CSharpParser 解析器 (基于 Roslyn)
- 添加 Microsoft.CodeAnalysis.CSharp NuGet 包
- 所有代码编译通过
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
This commit is contained in:
monkeycode-ai
2026-06-03 02:57:13 +00:00
parent d260763e7a
commit a0971cf974
21 changed files with 1553 additions and 16 deletions
@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Mvc;
namespace CodePlay.Web.Controllers;
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}