Compare commits

..

No commits in common. "master" and "1.2.1" have entirely different histories.

3 changed files with 6 additions and 19 deletions

View File

@ -2,7 +2,7 @@
"name": "maiyoule/mqttclient_author", "name": "maiyoule/mqttclient_author",
"type": "library", "type": "library",
"description": "MQTT管理模块操作库", "description": "MQTT管理模块操作库",
"version": "1.2.2", "version": "1.2.1",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
{ {

View File

@ -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'] ?? [], $data['err'] ?? ''); return new BizResponse($data['code'] ?? 0, $data['message'] ?? '', $data['data'] ?? []);
} catch (ClientException $e) { } catch (ClientException $e) {
$body = $e->getResponse()->getBody()->getContents(); $body = $e->getResponse()->getBody()->getContents();

View File

@ -6,22 +6,19 @@ class BizResponse
{ {
private int $code; private int $code;
private string $message; private string $message;
private mixed $data; private $data;
private string $errCode;
/** /**
* @param int $code * @param int $code
* @param string $message * @param string $message
* @param array $data * @param $data
* @param string $errCode
*/ */
public function __construct(int $code = -1, string $message = '', mixed $data = [], string $errCode = '') public function __construct(int $code = -1, string $message = '', $data = [])
{ {
$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
@ -52,7 +49,7 @@ class BizResponse
/** /**
* @return mixed * @return mixed
*/ */
public function getData(): mixed public function getData()
{ {
return $this->data; return $this->data;
} }
@ -65,15 +62,5 @@ class BizResponse
$this->data = $data; $this->data = $data;
} }
public function getErrCode(): string
{
return $this->errCode;
}
public function setErrCode(string $errCode): void
{
$this->errCode = $errCode;
}
} }