完成評審評分機制

This commit is contained in:
2025-09-18 18:34:31 +08:00
parent 2101767690
commit ffa1e45f63
54 changed files with 5730 additions and 709 deletions

View File

@@ -0,0 +1,34 @@
import { NextRequest, NextResponse } from 'next/server';
import { ScoringService } from '@/lib/services/database-service';
// 獲取評分完成度匯總
export async function GET(request: NextRequest) {
try {
const { searchParams } = new URL(request.url);
const competitionId = searchParams.get('competitionId');
if (!competitionId) {
return NextResponse.json({
success: false,
message: '缺少競賽ID參數'
}, { status: 400 });
}
// 獲取評分完成度匯總數據
const summary = await ScoringService.getScoringSummary(competitionId);
return NextResponse.json({
success: true,
message: '評分完成度匯總獲取成功',
data: summary
});
} catch (error) {
console.error('獲取評分完成度匯總失敗:', error);
return NextResponse.json({
success: false,
message: '獲取評分完成度匯總失敗',
error: error instanceof Error ? error.message : '未知錯誤'
}, { status: 500 });
}
}