IndexMeAgentThreadRequest.php 770 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Http\Requests\V3;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. /**
  5. * `GET /v3/me/agent-threads` 的入参:当前用户自己的 AI 对话会话列表。
  6. */
  7. class IndexMeAgentThreadRequest extends FormRequest
  8. {
  9. /**
  10. * 登录检查由 auth.v3 中间件做:authorize() 返回 false 会渲染成 403,
  11. * 而「没登录」应该是 401。
  12. */
  13. public function authorize(): bool
  14. {
  15. return true;
  16. }
  17. /**
  18. * @return array<string, array<int, mixed>>
  19. */
  20. public function rules(): array
  21. {
  22. return [
  23. 'filter.archived' => ['sometimes', 'in:true,false,1,0'],
  24. 'page' => ['integer', 'min:1'],
  25. 'per_page' => ['integer', 'min:1', 'max:100'],
  26. ];
  27. }
  28. }