完成評審評分機制

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,30 @@
// =====================================================
// 競賽規則 API
// =====================================================
import { NextRequest, NextResponse } from 'next/server';
import { ScoringService } from '@/lib/services/database-service';
// 獲取競賽的評分規則
export async function GET(request: NextRequest, { params }: { params: { id: string } }) {
try {
const { id } = await params;
// 獲取競賽規則
const rules = await ScoringService.getCompetitionRules(id);
return NextResponse.json({
success: true,
message: '競賽規則獲取成功',
data: rules
});
} catch (error) {
console.error('獲取競賽規則失敗:', error);
return NextResponse.json({
success: false,
message: '獲取競賽規則失敗',
error: error instanceof Error ? error.message : '未知錯誤'
}, { status: 500 });
}
}