新增command
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Hyperf\Command\Command as HyperfCommand;
|
||||
use Hyperf\Command\Annotation\Command;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
/**
|
||||
* 更新处方平台商品
|
||||
*/
|
||||
#[Command]
|
||||
class getProductCommand extends HyperfCommand
|
||||
{
|
||||
public function __construct(protected ContainerInterface $container)
|
||||
{
|
||||
parent::__construct('getProduct:command');
|
||||
}
|
||||
|
||||
public function configure()
|
||||
{
|
||||
parent::configure();
|
||||
$this->setDescription('获取处方平台商品数据');
|
||||
}
|
||||
|
||||
// 主逻辑处理
|
||||
public function handle()
|
||||
{
|
||||
$sign = $this->input->getArgument('sign');
|
||||
$this->line($sign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数设置
|
||||
* @return array[]
|
||||
*/
|
||||
protected function getArguments(): array
|
||||
{
|
||||
return [
|
||||
['sign', InputArgument::REQUIRED, '签名数据']
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -236,8 +236,8 @@ class UserController extends AbstractController
|
||||
// }
|
||||
|
||||
// 对接处方平台
|
||||
$Prescription = new Prescription();
|
||||
$token = $Prescription->getProd();
|
||||
dump($token);
|
||||
// $Prescription = new Prescription();
|
||||
// $token = $Prescription->getProd();
|
||||
// dump($token);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user