mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Generalize VisitsDateRangeInput to VisitsListInput to add more common params
This commit is contained in:
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\CLI\Command\Domain;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Command\Visit\VisitsCommandUtils;
|
||||
use Shlinkio\Shlink\CLI\Input\VisitsDateRangeInput;
|
||||
use Shlinkio\Shlink\CLI\Input\VisitsListInput;
|
||||
use Shlinkio\Shlink\CLI\Util\ShlinkTable;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
|
||||
use Shlinkio\Shlink\Core\Visit\Entity\Visit;
|
||||
@@ -34,9 +34,9 @@ class GetDomainVisitsCommand extends Command
|
||||
SymfonyStyle $io,
|
||||
#[Argument('The domain which visits we want to get'), Ask('For what domain do you want to get visits?')]
|
||||
string $domain,
|
||||
#[MapInput] VisitsDateRangeInput $dateRangeInput,
|
||||
#[MapInput] VisitsListInput $input,
|
||||
): int {
|
||||
$paginator = $this->visitsHelper->visitsForDomain($domain, new VisitsParams($dateRangeInput->toDateRange()));
|
||||
$paginator = $this->visitsHelper->visitsForDomain($domain, new VisitsParams($input->dateRange()));
|
||||
[$rows, $headers] = VisitsCommandUtils::resolveRowsAndHeaders($paginator, $this->mapExtraFields(...));
|
||||
|
||||
ShlinkTable::default($io)->render($headers, $rows);
|
||||
|
||||
Reference in New Issue
Block a user