<?php

namespace App\Http\Controllers;

use App\Services\PatentService;
use App\Traits\HasResponse;
use Illuminate\Http\Request;

class PatentController extends Controller
{
    use HasResponse;

    /** @var PatentService */
    private $patentService;

    public function __construct(PatentService $patentService)
    {
        $this->patentService = $patentService;
    }

    public function list(Request $request)
    {
        $withPagination = $this->validatePagination($request->only('perPage', 'page'));
        return $this->patentService->list($withPagination);
    }
}
