Merge branch 'release/1.1.2'

This commit is contained in:
X14XA\shengli 2025-05-15 16:34:04 +08:00
commit 9ad385e044
3 changed files with 49 additions and 16 deletions

View File

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

View File

@ -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';

View File

@ -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;