實作管理者用戶管理、邀請註冊功能

This commit is contained in:
2025-09-09 15:15:26 +08:00
parent 32b19e9a0f
commit 46bd9db2e3
11 changed files with 1297 additions and 214 deletions

View File

@@ -0,0 +1,34 @@
import { NextRequest, NextResponse } from 'next/server'
import { UserService } from '@/lib/services/database-service'
const userService = new UserService()
export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id: userId } = await params
if (!userId) {
return NextResponse.json(
{ success: false, error: '用戶 ID 是必需的' },
{ status: 400 }
)
}
const stats = await userService.getUserDetailedStats(userId)
return NextResponse.json({
success: true,
data: stats
})
} catch (error) {
console.error('獲取用戶統計數據錯誤:', error)
return NextResponse.json(
{ success: false, error: '獲取用戶統計數據時發生錯誤' },
{ status: 500 }
)
}
}