StoreMeReadingTimeRequest.php 598 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Requests\V3;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. /**
  5. * `POST /v3/me/reading-time` 的入参:一段读经时长。客户端每 5 分钟或切后台时报一次。
  6. */
  7. class StoreMeReadingTimeRequest extends FormRequest
  8. {
  9. public function authorize(): bool
  10. {
  11. return true;
  12. }
  13. /**
  14. * @return array<string, array<int, mixed>>
  15. */
  16. public function rules(): array
  17. {
  18. return [
  19. 'seconds' => ['required', 'integer', 'min:1', 'max:900'],
  20. 'day' => ['nullable', 'date_format:Y-m-d'],
  21. ];
  22. }
  23. }