{{-- 试卷 JSON 输出案例 --}}
试卷 JSON 输出案例
输入卷子 ID,返回与智能出卷 API 中 `exam_content` 完全一致的 JSON,可预览或导出。
等待输入 paper_id ...
{{-- API 文档列表 --}} @foreach ($apiGroups as $group)
{{ $group['name'] }}
{{ count($group['items']) }} 个接口
基于 Laravel 路由自动生成,配合详细文档说明
@foreach ($group['items'] as $item)
{{ $item['method'] }} {{ $item['path'] }} @if (!empty($item['tag'])) {{ $item['tag'] }} @endif 点击展开详情
{{-- 摘要和描述 --}} @if (!empty($item['details']['summary']))
{{ $item['details']['summary'] }}
@if (!empty($item['details']['description']))
{{ $item['details']['description'] }}
@endif
@endif {{-- 路由信息 --}}
@if (!empty($item['details']['route_name']))
路由名: {{ $item['details']['route_name'] }}
@endif @if (!empty($item['details']['action']))
Action: {{ $item['details']['action'] }}
@endif
{{-- 参数说明 --}} @if (!empty($item['details']['param_details']))
参数说明
@foreach ($item['details']['param_details'] as $paramGroup)
@if (!empty($paramGroup[0]) && is_string($paramGroup[0]))
{{ $paramGroup[0] }}
@php $params = array_slice($paramGroup, 1) @endphp @else @php $params = $paramGroup @endphp @endif
@foreach ($params as $param) @endforeach
名称 类型 必填 默认值 说明
{{ $param['name'] }} {{ $param['type'] }} @if ($param['required']) @else @endif {{ $param['default'] ?? '-' }} {{ $param['description'] }}
@endforeach
@endif {{-- 响应示例 --}} @if (!empty($item['details']['response_examples']))
响应示例
@foreach ($item['details']['response_examples'] as $responseType => $responseExample)
{{ $responseType }}
{{ json_encode($responseExample, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@endforeach
@endif {{-- 使用示例 --}} @if (!empty($item['details']['examples']))
使用示例
@foreach ($item['details']['examples'] as $example)
{{ $example }}
@endforeach
@endif {{-- 在线测试按钮 --}} @if ($item['doc'])
{{-- 测试表单 --}} @endif
@endforeach
@endforeach