2021-05-20 16:53:34 +08:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Command;
|
|
|
|
|
2021-09-12 16:23:43 +08:00
|
|
|
use App\Cache\IpAddressCache;
|
2022-01-22 20:08:19 +08:00
|
|
|
use App\Constant\RobotConstant;
|
2022-01-17 21:06:27 +08:00
|
|
|
use App\Model\Contact\Contact;
|
2021-08-27 22:55:42 +08:00
|
|
|
use App\Repository\ExampleRepository;
|
2021-09-12 21:15:38 +08:00
|
|
|
use App\Repository\RobotRepository;
|
2021-09-12 16:23:43 +08:00
|
|
|
use App\Service\RobotService;
|
|
|
|
use App\Support\IpAddress;
|
2021-05-20 16:53:34 +08:00
|
|
|
use Hyperf\Command\Command as HyperfCommand;
|
|
|
|
use Hyperf\Command\Annotation\Command;
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Command
|
|
|
|
*/
|
|
|
|
class TestCommand extends HyperfCommand
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var ContainerInterface
|
|
|
|
*/
|
|
|
|
protected $container;
|
|
|
|
|
|
|
|
public function __construct(ContainerInterface $container)
|
|
|
|
{
|
|
|
|
$this->container = $container;
|
|
|
|
|
|
|
|
parent::__construct('test:command');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function configure()
|
|
|
|
{
|
|
|
|
parent::configure();
|
|
|
|
$this->setDescription('Hyperf Demo Command');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handle()
|
|
|
|
{
|
2021-09-12 16:23:43 +08:00
|
|
|
// $repository = di()->get(ExampleRepository::class);
|
|
|
|
// $repository->where_case2();
|
2021-08-28 16:11:38 +08:00
|
|
|
|
2021-09-12 21:15:38 +08:00
|
|
|
// di()->get(RobotService::class)->create([
|
|
|
|
// 'robot_name' => "登录助手",
|
|
|
|
// 'describe' => "异地登录助手",
|
|
|
|
// 'logo' => '',
|
|
|
|
// 'is_talk' => 0,
|
|
|
|
// 'type' => 1,
|
|
|
|
// ]);
|
2021-05-20 16:53:34 +08:00
|
|
|
}
|
|
|
|
}
|