77 lines
1.4 KiB
PHP
77 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace cn\com\maiyoule\mqttclient\biz;
|
|
|
|
use cn\com\maiyoule\mqttclient\IRequest;
|
|
|
|
class AppUserCreateRequest extends IRequest
|
|
{
|
|
|
|
public function path(): string
|
|
{
|
|
return 'mqtt/user/create';
|
|
}
|
|
|
|
public function body(): array
|
|
{
|
|
return [
|
|
'password' => $this->getPassword(),
|
|
'fettle' => $this->getFettle(),
|
|
'role' => $this->getRole(),
|
|
'biz' => join(',', $this->getBiz())
|
|
];
|
|
}
|
|
|
|
private array $biz = [];
|
|
|
|
public function getBiz(): array
|
|
{
|
|
return $this->biz;
|
|
}
|
|
|
|
public function setBiz(array|string $biz): void
|
|
{
|
|
if (is_string($biz)) {
|
|
$biz = [$biz];
|
|
}
|
|
$this->biz = $biz;
|
|
}
|
|
|
|
private string $password = '';
|
|
private string $fettle = '';
|
|
private string $role = 'user';
|
|
|
|
|
|
public function getRole(): string
|
|
{
|
|
return $this->role;
|
|
}
|
|
|
|
public function setRole(string $role): void
|
|
{
|
|
$this->role = $role;
|
|
}
|
|
|
|
|
|
public function getPassword(): string
|
|
{
|
|
return $this->password;
|
|
}
|
|
|
|
public function setPassword(string $password): void
|
|
{
|
|
$this->password = $password;
|
|
}
|
|
|
|
public function getFettle(): string
|
|
{
|
|
return $this->fettle;
|
|
}
|
|
|
|
public function setFettle(string $fettle): void
|
|
{
|
|
$this->fettle = $fettle;
|
|
}
|
|
|
|
|
|
} |