feat: 完成代码逻辑错误修复和任务清理系统实现

主要更新:
- 修复了所有主要的代码逻辑错误
- 实现了完整的任务清理系统
- 添加了系统设置页面的任务清理管理功能
- 修复了API调用认证问题
- 优化了密码加密和验证机制
- 统一了错误处理模式
- 添加了详细的文档和测试工具

新增功能:
- 任务清理管理界面
- 任务归档和清理日志
- API监控和诊断工具
- 完整的测试套件

技术改进:
- 修复了Repository方法调用错误
- 统一了模型方法调用
- 改进了类型安全性
- 优化了代码结构和可维护性
This commit is contained in:
AIGC Developer
2025-10-27 10:46:49 +08:00
parent 473e0f6a7e
commit 8c55f9f376
161 changed files with 22720 additions and 327 deletions

60
demo/test-cleanup.ps1 Normal file
View File

@@ -0,0 +1,60 @@
# 任务清理功能测试脚本 (PowerShell版本)
Write-Host "=== 任务清理功能测试 ===" -ForegroundColor Green
# 1. 检查当前任务状态
Write-Host "`n1. 检查当前任务状态..." -ForegroundColor Yellow
try {
$response = Invoke-WebRequest -Uri "http://localhost:8080/api/diagnostic/queue-status" -Method GET
$status = $response.Content | ConvertFrom-Json
Write-Host "当前任务状态:" -ForegroundColor Cyan
$status | ConvertTo-Json -Depth 3
} catch {
Write-Host "获取任务状态失败: $($_.Exception.Message)" -ForegroundColor Red
}
# 2. 获取清理统计信息
Write-Host "`n2. 获取清理统计信息..." -ForegroundColor Yellow
try {
$response = Invoke-WebRequest -Uri "http://localhost:8080/api/cleanup/cleanup-stats" -Method GET
$stats = $response.Content | ConvertFrom-Json
Write-Host "清理统计信息:" -ForegroundColor Cyan
$stats | ConvertTo-Json -Depth 3
} catch {
Write-Host "获取清理统计失败: $($_.Exception.Message)" -ForegroundColor Red
}
# 3. 执行完整清理
Write-Host "`n3. 执行完整清理..." -ForegroundColor Yellow
try {
$response = Invoke-WebRequest -Uri "http://localhost:8080/api/cleanup/full-cleanup" -Method POST
$result = $response.Content | ConvertFrom-Json
Write-Host "清理结果:" -ForegroundColor Cyan
$result | ConvertTo-Json -Depth 3
} catch {
Write-Host "执行清理失败: $($_.Exception.Message)" -ForegroundColor Red
}
# 4. 再次检查任务状态
Write-Host "`n4. 清理后任务状态..." -ForegroundColor Yellow
try {
$response = Invoke-WebRequest -Uri "http://localhost:8080/api/diagnostic/queue-status" -Method GET
$status = $response.Content | ConvertFrom-Json
Write-Host "清理后任务状态:" -ForegroundColor Cyan
$status | ConvertTo-Json -Depth 3
} catch {
Write-Host "获取清理后状态失败: $($_.Exception.Message)" -ForegroundColor Red
}
# 5. 获取最终统计信息
Write-Host "`n5. 最终统计信息..." -ForegroundColor Yellow
try {
$response = Invoke-WebRequest -Uri "http://localhost:8080/api/cleanup/cleanup-stats" -Method GET
$stats = $response.Content | ConvertFrom-Json
Write-Host "最终统计信息:" -ForegroundColor Cyan
$stats | ConvertTo-Json -Depth 3
} catch {
Write-Host "获取最终统计失败: $($_.Exception.Message)" -ForegroundColor Red
}
Write-Host "`n=== 测试完成 ===" -ForegroundColor Green