6745fba6ba
Task 4.5 - 转换界面完善: - ConverterView.vue: 完整转换界面 - 集成 Monaco Editor 代码编辑器 - 语言选择器 (C#/Java) - 验证轮次选择 (1-3 轮) - 转换结果显示 - 转换报告弹窗 (TODO 和问题) - 光标位置显示 - 复制结果功能 - 状态栏统计 Task 4.7 - 项目管理界面: - ProjectView.vue: 项目管理页面 - 项目列表展示 - 新建项目对话框 - 项目详情和转换历史 - 项目删除功能 - 路由配置更新 Task 7.3 - 数据库持久化: - CodePlay.Persistence 项目创建 - AppDbContext: SQLite DbContext - ConversionReport 和 ProjectInfo 数据模型 - DatabaseStorageService: IReportStorageService 实现 - 支持报告存储、查询、删除 - 统计信息聚合 - AddPersistence 扩展方法 测试:42 个测试(41 通过,1 跳过)✅ 新增文件: - CodePlay.Web/src/views/ConverterView.vue - CodePlay.Web/src/views/ProjectView.vue - CodePlay.Persistence/AppDbContext.cs - CodePlay.Persistence/DatabaseStorageService.cs - CodePlay.Web/src/router/index.ts (更新) Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
32 lines
1006 B
C#
32 lines
1006 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using CodePlay.Core.Models;
|
|
|
|
namespace CodePlay.Persistence;
|
|
|
|
public class AppDbContext : DbContext
|
|
{
|
|
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
|
|
|
|
public DbSet<ConversionReport> ConversionReports { get; set; }
|
|
public DbSet<ProjectInfo> Projects { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<ConversionReport>(entity =>
|
|
{
|
|
entity.HasKey(e => e.Id);
|
|
entity.Property(e => e.Id).HasMaxLength(50);
|
|
entity.Property(e => e.ProjectId).HasMaxLength(50);
|
|
entity.HasIndex(e => e.ProjectId);
|
|
entity.HasIndex(e => e.CreatedAt);
|
|
});
|
|
|
|
modelBuilder.Entity<ProjectInfo>(entity =>
|
|
{
|
|
entity.HasKey(e => e.Id);
|
|
entity.Property(e => e.Id).HasMaxLength(50);
|
|
entity.Property(e => e.Name).HasMaxLength(200);
|
|
});
|
|
}
|
|
}
|