Compare commits

..

No commits in common. "9b926634cf863f7e66f05d38c34b64af195f3011" and "3c5020b80ba0d66e49d2e12708354e9af54ad801" have entirely different histories.

3 changed files with 16 additions and 49 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.1.2", "version": "1.1.1",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
{ {

View File

@ -18,44 +18,25 @@ class AppUserCreateRequest extends IRequest
'password' => $this->getPassword(), 'password' => $this->getPassword(),
'fettle' => $this->getFettle(), 'fettle' => $this->getFettle(),
'role' => $this->getRole(), 'role' => $this->getRole(),
'publish' => join(',', $this->getPublish()), 'biz' => join(',', $this->getBiz())
'subscribe' => join(',', $this->getSubscribe()),
]; ];
} }
private array $subscribe = []; private array $biz = [];
public function getSubscribe(): array public function getBiz(): array
{ {
return $this->subscribe; return $this->biz;
} }
public function setSubscribe(array|string $subscribe): void public function setBiz(array|string $biz): void
{ {
if (is_string($subscribe)) { if (is_string($biz)) {
$subscribe = [$subscribe]; $biz = [$biz];
} }
$this->subscribe = $subscribe; $this->biz = $biz;
} }
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 $password = '';
private string $fettle = ''; private string $fettle = '';
private string $role = 'user'; private string $role = 'user';

View File

@ -29,37 +29,23 @@ class AppUserUpdateRequest extends IRequest
if (!is_null($this->fettle)) { if (!is_null($this->fettle)) {
$data['fettle'] = $this->fettle; $data['fettle'] = $this->fettle;
} }
if (!empty($this->publish)) { if (!is_null($this->biz)) {
$data['publish'] = join(',', $this->getPublish()); $data['biz'] = join(',', $this->biz);
}
if (!empty($this->subscribe)) {
$data['subscribe'] = join(',', $this->getSubscribe());
} }
return $data; return $data;
} }
private array $subscribe = []; private ?array $biz = null;
public function getSubscribe(): array public function getBiz(): array
{ {
return $this->subscribe; return $this->biz;
} }
public function setSubscribe(array|string $subscribe): void public function setBiz(array $biz): void
{ {
if (is_string($subscribe)) { $this->biz = $biz;
$subscribe = [$subscribe];
}
$this->subscribe = $subscribe;
}
private array $publish = [];
public function getPublish(): array
{
return $this->publish;
} }
private string $username; private string $username;