Compare commits

8 Commits

Author SHA1 Message Date
7343267d3c Merge branch 'release/1.2.1' 2025-05-15 17:53:37 +08:00
9028a8c59d 1.2.1 2025-05-15 17:53:26 +08:00
daefbe884c 增加用户的过期时间 2025-05-15 17:52:55 +08:00
9ad385e044 Merge branch 'release/1.1.2' 2025-05-15 16:34:04 +08:00
9b926634cf Merge tag '1.1.2' into develop 2025-05-15 16:34:04 +08:00
320739411a 1.1.2 2025-05-15 16:33:52 +08:00
cffc90dfc9 更新创建和修改参数 2025-05-15 16:32:42 +08:00
3c5020b80b Merge tag '1.1.1' into develop 2025-05-13 23:49:39 +08:00
3 changed files with 65 additions and 16 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.1", "version": "1.2.1",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
{ {

View File

@@ -18,25 +18,60 @@ class AppUserCreateRequest extends IRequest
'password' => $this->getPassword(), 'password' => $this->getPassword(),
'fettle' => $this->getFettle(), 'fettle' => $this->getFettle(),
'role' => $this->getRole(), 'role' => $this->getRole(),
'biz' => join(',', $this->getBiz()) 'publish' => join(',', $this->getPublish()),
'subscribe' => join(',', $this->getSubscribe()),
'expire' => $this->expireAt
]; ];
} }
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)) { if (is_string($subscribe)) {
$biz = [$biz]; $subscribe = [$subscribe];
} }
$this->biz = $biz; $this->subscribe = $subscribe;
} }
/**
* @var string 过期时间
*/
private string $expireAt = '';
public function getExpireAt(): string
{
return $this->expireAt;
}
public function setExpireAt(string $expireAt): void
{
$this->expireAt = $expireAt;
}
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,23 +29,37 @@ class AppUserUpdateRequest extends IRequest
if (!is_null($this->fettle)) { if (!is_null($this->fettle)) {
$data['fettle'] = $this->fettle; $data['fettle'] = $this->fettle;
} }
if (!is_null($this->biz)) { if (!empty($this->publish)) {
$data['biz'] = join(',', $this->biz); $data['publish'] = join(',', $this->getPublish());
}
if (!empty($this->subscribe)) {
$data['subscribe'] = join(',', $this->getSubscribe());
} }
return $data; 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; private string $username;