From cffc90dfc93824917b5ec1cd9f59cf35f50691a5 Mon Sep 17 00:00:00 2001 From: "X14XA\\shengli" Date: Thu, 15 May 2025 16:32:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=92=8C=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/biz/AppUserCreateRequest.php | 35 ++++++++++++++++++++++++-------- src/biz/AppUserUpdateRequest.php | 28 ++++++++++++++++++------- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/biz/AppUserCreateRequest.php b/src/biz/AppUserCreateRequest.php index 16f0075..bf74220 100644 --- a/src/biz/AppUserCreateRequest.php +++ b/src/biz/AppUserCreateRequest.php @@ -18,25 +18,44 @@ class AppUserCreateRequest extends IRequest 'password' => $this->getPassword(), 'fettle' => $this->getFettle(), 'role' => $this->getRole(), - 'biz' => join(',', $this->getBiz()) + 'publish' => join(',', $this->getPublish()), + 'subscribe' => join(',', $this->getSubscribe()), ]; } - private array $biz = []; + private array $subscribe = []; - public function getBiz(): array + public function getSubscribe(): array { - return $this->biz; + return $this->subscribe; } - public function setBiz(array|string $biz): void + public function setSubscribe(array|string $subscribe): void { - if (is_string($biz)) { - $biz = [$biz]; + if (is_string($subscribe)) { + $subscribe = [$subscribe]; } - $this->biz = $biz; + $this->subscribe = $subscribe; } + + private array $publish = []; + + public function getPublish(): array + { + return $this->publish; + } + + public function setPublish(array|string $publish): void + { + if (is_string($publish)) { + $publish = [$publish]; + } + + $this->publish = $publish; + } + + private string $password = ''; private string $fettle = ''; private string $role = 'user'; diff --git a/src/biz/AppUserUpdateRequest.php b/src/biz/AppUserUpdateRequest.php index eb30636..65284dd 100644 --- a/src/biz/AppUserUpdateRequest.php +++ b/src/biz/AppUserUpdateRequest.php @@ -29,23 +29,37 @@ class AppUserUpdateRequest extends IRequest if (!is_null($this->fettle)) { $data['fettle'] = $this->fettle; } - if (!is_null($this->biz)) { - $data['biz'] = join(',', $this->biz); + if (!empty($this->publish)) { + $data['publish'] = join(',', $this->getPublish()); + } + if (!empty($this->subscribe)) { + $data['subscribe'] = join(',', $this->getSubscribe()); } return $data; } - private ?array $biz = null; + private array $subscribe = []; - public function getBiz(): array + public function getSubscribe(): array { - return $this->biz; + return $this->subscribe; } - public function setBiz(array $biz): void + public function setSubscribe(array|string $subscribe): void { - $this->biz = $biz; + if (is_string($subscribe)) { + $subscribe = [$subscribe]; + } + $this->subscribe = $subscribe; + } + + + private array $publish = []; + + public function getPublish(): array + { + return $this->publish; } private string $username; From 320739411a69b17a662e3b0275e97f54bd66b7ef Mon Sep 17 00:00:00 2001 From: "X14XA\\shengli" Date: Thu, 15 May 2025 16:33:52 +0800 Subject: [PATCH 2/2] 1.1.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9a40949..a512b44 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "maiyoule/mqttclient_author", "type": "library", "description": "MQTT管理模块操作库", - "version": "1.1.1", + "version": "1.1.2", "license": "MIT", "authors": [ {