Add group commands
This commit is contained in:
@ -20,6 +20,9 @@ class Application extends \Symfony\Component\Console\Application
|
||||
$this->add(new Command\Slot\SlotQueryCommand($client));
|
||||
$this->add(new Command\Slot\SlotFindCommand($client));
|
||||
$this->add(new Command\Slot\SlotSetCommand($client));
|
||||
|
||||
$this->add(new Command\Group\GroupFindCommand($client));
|
||||
$this->add(new Command\Group\GroupShowCommand($client));
|
||||
}
|
||||
|
||||
}
|
||||
|
37
src/Command/Group/GroupFindCommand.php
Normal file
37
src/Command/Group/GroupFindCommand.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace SlotDb\Cli\Command\Group;
|
||||
|
||||
use SlotDb\Client\SlotDbClient;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Helper\Table;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[AsCommand(name:"group:find", aliases:[ "groups" ], description:"Find all groups")]
|
||||
class GroupFindCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private readonly SlotDbClient $client
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
|
||||
$groups = $this->client->findGroups();
|
||||
|
||||
var_dump($groups);
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
37
src/Command/Group/GroupShowCommand.php
Normal file
37
src/Command/Group/GroupShowCommand.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace SlotDb\Cli\Command\Group;
|
||||
|
||||
use SlotDb\Client\SlotDbClient;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Helper\Table;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[AsCommand(name:"group:show", description:"Show slots in a group")]
|
||||
class GroupShowCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private readonly SlotDbClient $client
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
|
||||
$groups = $this->client->findGroups();
|
||||
|
||||
var_dump($groups);
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user