Skip to content

Commit 37cc3b8

Browse files
committed
chore: remove obsolete SQL update script
- Delete sql/update.sql containing manual database schema definitions - Schema is now managed through EF Core migrations instead of manual SQL scripts
1 parent d698978 commit 37cc3b8

File tree

13 files changed

+2569
-901
lines changed

13 files changed

+2569
-901
lines changed

sql/update.sql

Lines changed: 0 additions & 778 deletions
This file was deleted.

src/OpenDeepWiki/Endpoints/Admin/AdminRepositoryEndpoints.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ public static RouteGroupBuilder MapAdminRepositoryEndpoints(this RouteGroupBuild
4343
.WithName("AdminGetRepository")
4444
.WithSummary("获取仓库详情");
4545

46+
// 获取仓库深度管理信息(分支、语言、增量任务)
47+
repoGroup.MapGet("/{id}/management", async (
48+
string id,
49+
[FromServices] IAdminRepositoryService repositoryService) =>
50+
{
51+
var result = await repositoryService.GetRepositoryManagementAsync(id);
52+
if (result == null)
53+
return Results.NotFound(new { success = false, message = "仓库不存在" });
54+
return Results.Ok(new { success = true, data = result });
55+
})
56+
.WithName("AdminGetRepositoryManagement")
57+
.WithSummary("获取仓库深度管理信息");
58+
4659
// 更新仓库
4760
repoGroup.MapPut("/{id}", async (
4861
string id,
@@ -95,6 +108,43 @@ public static RouteGroupBuilder MapAdminRepositoryEndpoints(this RouteGroupBuild
95108
.WithName("AdminSyncRepositoryStats")
96109
.WithSummary("同步仓库统计信息");
97110

111+
// 触发仓库全量重生成
112+
repoGroup.MapPost("/{id}/regenerate", async (
113+
string id,
114+
[FromServices] IAdminRepositoryService repositoryService) =>
115+
{
116+
var result = await repositoryService.RegenerateRepositoryAsync(id);
117+
return Results.Ok(new { success = result.Success, message = result.Message, data = result });
118+
})
119+
.WithName("AdminRegenerateRepository")
120+
.WithSummary("触发仓库全量重生成");
121+
122+
// 触发指定文档重生成
123+
repoGroup.MapPost("/{id}/documents/regenerate", async (
124+
string id,
125+
[FromBody] RegenerateRepositoryDocumentRequest request,
126+
[FromServices] IAdminRepositoryService repositoryService,
127+
CancellationToken cancellationToken) =>
128+
{
129+
var result = await repositoryService.RegenerateDocumentAsync(id, request, cancellationToken);
130+
return Results.Ok(new { success = result.Success, message = result.Message, data = result });
131+
})
132+
.WithName("AdminRegenerateRepositoryDocument")
133+
.WithSummary("触发指定文档重生成");
134+
135+
// 手动更新指定文档内容
136+
repoGroup.MapPut("/{id}/documents/content", async (
137+
string id,
138+
[FromBody] UpdateRepositoryDocumentContentRequest request,
139+
[FromServices] IAdminRepositoryService repositoryService,
140+
CancellationToken cancellationToken) =>
141+
{
142+
var result = await repositoryService.UpdateDocumentContentAsync(id, request, cancellationToken);
143+
return Results.Ok(new { success = result.Success, message = result.Message, data = result });
144+
})
145+
.WithName("AdminUpdateRepositoryDocumentContent")
146+
.WithSummary("手动更新指定文档内容");
147+
98148
// 批量同步仓库统计信息
99149
repoGroup.MapPost("/batch/sync-stats", async (
100150
[FromBody] BatchOperationRequest request,

src/OpenDeepWiki/Models/Admin/RepositoryModels.cs

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,95 @@ public class BatchDeleteResult
9797
public List<string> FailedIds { get; set; } = new();
9898
}
9999

100+
/// <summary>
101+
/// 管理端仓库深度管理信息
102+
/// </summary>
103+
public class AdminRepositoryManagementDto
104+
{
105+
public string RepositoryId { get; set; } = string.Empty;
106+
public string OrgName { get; set; } = string.Empty;
107+
public string RepoName { get; set; } = string.Empty;
108+
public int Status { get; set; }
109+
public string StatusText { get; set; } = string.Empty;
110+
public List<AdminRepositoryBranchDto> Branches { get; set; } = new();
111+
public List<AdminIncrementalTaskDto> RecentIncrementalTasks { get; set; } = new();
112+
}
113+
114+
/// <summary>
115+
/// 管理端分支信息
116+
/// </summary>
117+
public class AdminRepositoryBranchDto
118+
{
119+
public string Id { get; set; } = string.Empty;
120+
public string Name { get; set; } = string.Empty;
121+
public string? LastCommitId { get; set; }
122+
public DateTime? LastProcessedAt { get; set; }
123+
public List<AdminBranchLanguageDto> Languages { get; set; } = new();
124+
}
125+
126+
/// <summary>
127+
/// 管理端分支语言信息
128+
/// </summary>
129+
public class AdminBranchLanguageDto
130+
{
131+
public string Id { get; set; } = string.Empty;
132+
public string LanguageCode { get; set; } = string.Empty;
133+
public bool IsDefault { get; set; }
134+
public int CatalogCount { get; set; }
135+
public int DocumentCount { get; set; }
136+
public DateTime CreatedAt { get; set; }
137+
}
138+
139+
/// <summary>
140+
/// 管理端增量更新任务信息
141+
/// </summary>
142+
public class AdminIncrementalTaskDto
143+
{
144+
public string TaskId { get; set; } = string.Empty;
145+
public string BranchId { get; set; } = string.Empty;
146+
public string? BranchName { get; set; }
147+
public string Status { get; set; } = string.Empty;
148+
public int Priority { get; set; }
149+
public bool IsManualTrigger { get; set; }
150+
public int RetryCount { get; set; }
151+
public string? PreviousCommitId { get; set; }
152+
public string? TargetCommitId { get; set; }
153+
public string? ErrorMessage { get; set; }
154+
public DateTime CreatedAt { get; set; }
155+
public DateTime? StartedAt { get; set; }
156+
public DateTime? CompletedAt { get; set; }
157+
}
158+
159+
/// <summary>
160+
/// 管理端文档重生成请求
161+
/// </summary>
162+
public class RegenerateRepositoryDocumentRequest
163+
{
164+
public string BranchId { get; set; } = string.Empty;
165+
public string LanguageCode { get; set; } = string.Empty;
166+
public string DocumentPath { get; set; } = string.Empty;
167+
}
168+
169+
/// <summary>
170+
/// 管理端文档内容更新请求
171+
/// </summary>
172+
public class UpdateRepositoryDocumentContentRequest
173+
{
174+
public string BranchId { get; set; } = string.Empty;
175+
public string LanguageCode { get; set; } = string.Empty;
176+
public string DocumentPath { get; set; } = string.Empty;
177+
public string Content { get; set; } = string.Empty;
178+
}
179+
180+
/// <summary>
181+
/// 管理端操作统一响应
182+
/// </summary>
183+
public class AdminRepositoryOperationResult
184+
{
185+
public bool Success { get; set; }
186+
public string Message { get; set; } = string.Empty;
187+
}
188+
100189
/// <summary>
101190
/// 批量操作请求
102191
/// </summary>

0 commit comments

Comments
 (0)