<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\V1\Admin\Auth\MeController;
use App\Http\Controllers\Api\V1\Admin\Audit\AuditLogIndexController;
use App\Http\Controllers\Api\V1\Admin\Dashboard\AdminDashboardAnalyticsController;
use App\Http\Controllers\Api\V1\Admin\Dashboard\AdminDashboardController;
use App\Http\Controllers\Api\V1\Admin\PingController as AdminPingController;

/**
 * 管理员核心路由（需 auth:sanctum + lottery.admin）。
 */

// 连通性探测
Route::get('ping', AdminPingController::class)
    ->middleware('admin.api-resource')
    ->name('api.v1.admin.ping');

// 首页仪表盘
Route::get('dashboard', AdminDashboardController::class)
    ->middleware('admin.api-resource')
    ->name('api.v1.admin.dashboard');

Route::get('dashboard/analytics', AdminDashboardAnalyticsController::class)
    ->middleware('admin.api-resource')
    ->name('api.v1.admin.dashboard.analytics');

// 当前管理员摘要
Route::get('auth/me', MeController::class)
    ->middleware('admin.api-resource')
    ->name('api.v1.admin.auth.me');

// 审计日志
Route::middleware('admin.api-resource')
    ->get('audit-logs', AuditLogIndexController::class)
    ->name('api.v1.admin.audit-logs.index');
