Compare commits
9 Commits
9ad385e044
...
develop
Author | SHA1 | Date | |
---|---|---|---|
2801dec5b9 | |||
9607f69e24 | |||
6d3709da51 | |||
1456b21f34 | |||
7343267d3c | |||
430af8aede | |||
9028a8c59d | |||
daefbe884c | |||
9b926634cf |
@@ -2,7 +2,7 @@
|
|||||||
"name": "maiyoule/mqttclient_author",
|
"name": "maiyoule/mqttclient_author",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "MQTT管理模块操作库",
|
"description": "MQTT管理模块操作库",
|
||||||
"version": "1.1.2",
|
"version": "1.2.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@@ -162,7 +162,7 @@ class AuthorServerClient
|
|||||||
return new BizResponse();
|
return new BizResponse();
|
||||||
}
|
}
|
||||||
$data = json_decode($content, true);
|
$data = json_decode($content, true);
|
||||||
return new BizResponse($data['code'] ?? 0, $data['message'] ?? '', $data['data'] ?? []);
|
return new BizResponse($data['code'] ?? 0, $data['message'] ?? '', $data['data'] ?? [], $data['err'] ?? '');
|
||||||
|
|
||||||
} catch (ClientException $e) {
|
} catch (ClientException $e) {
|
||||||
$body = $e->getResponse()->getBody()->getContents();
|
$body = $e->getResponse()->getBody()->getContents();
|
||||||
|
@@ -20,6 +20,7 @@ class AppUserCreateRequest extends IRequest
|
|||||||
'role' => $this->getRole(),
|
'role' => $this->getRole(),
|
||||||
'publish' => join(',', $this->getPublish()),
|
'publish' => join(',', $this->getPublish()),
|
||||||
'subscribe' => join(',', $this->getSubscribe()),
|
'subscribe' => join(',', $this->getSubscribe()),
|
||||||
|
'expire' => $this->expireAt
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,6 +39,21 @@ class AppUserCreateRequest extends IRequest
|
|||||||
$this->subscribe = $subscribe;
|
$this->subscribe = $subscribe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string 过期时间
|
||||||
|
*/
|
||||||
|
private string $expireAt = '';
|
||||||
|
|
||||||
|
public function getExpireAt(): string
|
||||||
|
{
|
||||||
|
return $this->expireAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setExpireAt(string $expireAt): void
|
||||||
|
{
|
||||||
|
$this->expireAt = $expireAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private array $publish = [];
|
private array $publish = [];
|
||||||
|
|
||||||
|
@@ -6,19 +6,22 @@ class BizResponse
|
|||||||
{
|
{
|
||||||
private int $code;
|
private int $code;
|
||||||
private string $message;
|
private string $message;
|
||||||
private $data;
|
private mixed $data;
|
||||||
|
|
||||||
|
private string $errCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $code
|
* @param int $code
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param $data
|
* @param array $data
|
||||||
|
* @param string $errCode
|
||||||
*/
|
*/
|
||||||
public function __construct(int $code = -1, string $message = '', $data = [])
|
public function __construct(int $code = -1, string $message = '', mixed $data = [], string $errCode = '')
|
||||||
{
|
{
|
||||||
$this->code = $code;
|
$this->code = $code;
|
||||||
$this->message = $message;
|
$this->message = $message;
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
|
$this->errCode = $errCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isSuccess(): bool
|
public function isSuccess(): bool
|
||||||
@@ -49,7 +52,7 @@ class BizResponse
|
|||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getData()
|
public function getData(): mixed
|
||||||
{
|
{
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
@@ -62,5 +65,15 @@ class BizResponse
|
|||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getErrCode(): string
|
||||||
|
{
|
||||||
|
return $this->errCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setErrCode(string $errCode): void
|
||||||
|
{
|
||||||
|
$this->errCode = $errCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user