$ composer require "alex-qiu/hyperf-express"
$ php bin/hyperf.php vendor:publish alex-qiu/hyperf-express
use AlexQiu\Express\Express;
$config = [
// HTTP 请求的超时时间(秒)
'timeout' => 5.0,
// 默认配置
'default' => [
'gateway' => 'kdniao',
],
// 可用的网关配置
'gateways' => [
'kdniao' => [
'app_id' => '', // SDK APP ID
'api_key' => '', // APP KEY
],
],
];
/**
* @var Express
*/
public $express;
public function __construct(ExpressInterface $express)
{
$this->express = $express;
}
public function index()
{
return $this->express->track([
"logistic_code" => "JDVA00003618100",
"shipper_code" => "JD"
]);
}