<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use Kylin\Prompt\Http\Controllers\PromptController;

/**
 * 提示文案 API 路由
 *
 * 查询类路由公开访问（提示语为公开信息）；
 * 管理类路由（缓存清除）需通过 auth:sanctum 鉴权。
 */
Route::prefix('kylin/prompt')->group(function () {
    // 公开查询
    Route::get('/show', [PromptController::class, 'show']);
    Route::get('/by-age', [PromptController::class, 'byAge']);
    Route::get('/all', [PromptController::class, 'all']);
    Route::get('/by-age-group', [PromptController::class, 'byAgeGroup']);
    Route::get('/compliance-notice', [PromptController::class, 'complianceNotice']);

    // 需鉴权的管理操作
    Route::middleware(['auth:sanctum'])->group(function () {
        Route::post('/mark-ai', [PromptController::class, 'markAI']);
        Route::post('/clear-cache', [PromptController::class, 'clearCache']);
    });
});
