Compare commits

..

No commits in common. "9ad385e04407e9c45cf9457806c0fa8ef5b53cb1" and "5b84406652fea5d79b2ecc4987316d777c1b22c7" have entirely different histories.

3 changed files with 16 additions and 49 deletions

View File

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

View File

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

View File

@ -29,37 +29,23 @@ class AppUserUpdateRequest extends IRequest
if (!is_null($this->fettle)) {
$data['fettle'] = $this->fettle;
}
if (!empty($this->publish)) {
$data['publish'] = join(',', $this->getPublish());
}
if (!empty($this->subscribe)) {
$data['subscribe'] = join(',', $this->getSubscribe());
if (!is_null($this->biz)) {
$data['biz'] = join(',', $this->biz);
}
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)) {
$subscribe = [$subscribe];
}
$this->subscribe = $subscribe;
}
private array $publish = [];
public function getPublish(): array
{
return $this->publish;
$this->biz = $biz;
}
private string $username;