import { NextResponse } from 'next/server'
import { SubscriptionService } from '@/lib/subscription-service'

// GET - 获取所有可用的订阅套餐（公开接口）
export async function GET() {
  try {
    const plans = await SubscriptionService.getAvailablePlans()
    return NextResponse.json({ plans })
  } catch (error) {
    console.error('Error fetching subscription plans:', error)
    return NextResponse.json(
      { error: 'Failed to fetch subscription plans' },
      { status: 500 }
    )
  }
}
