MQTT 管理客户端
This commit is contained in:
110
src/biz/AppUserUpdateRequest.php
Normal file
110
src/biz/AppUserUpdateRequest.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace cn\com\maiyoule\mqttclient\biz;
|
||||
|
||||
use cn\com\maiyoule\mqttclient\IRequest;
|
||||
|
||||
/**
|
||||
* 用户修改请求
|
||||
*/
|
||||
class AppUserUpdateRequest extends IRequest
|
||||
{
|
||||
|
||||
public function path(): string
|
||||
{
|
||||
return 'mqtt/user/update';
|
||||
}
|
||||
|
||||
public function body(): array
|
||||
{
|
||||
$data = [
|
||||
'username' => $this->getUsername(),
|
||||
'state' => $this->isState() ? 0 : 1,
|
||||
'role' => $this->getRole()
|
||||
];
|
||||
|
||||
if (!is_null($this->password)) {
|
||||
$data['password'] = $this->password;
|
||||
}
|
||||
if (!is_null($this->fettle)) {
|
||||
$data['fettle'] = $this->fettle;
|
||||
}
|
||||
if (!is_null($this->biz)) {
|
||||
$data['biz'] = join(',', $this->biz);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private ?array $biz = null;
|
||||
|
||||
public function getBiz(): array
|
||||
{
|
||||
return $this->biz;
|
||||
}
|
||||
|
||||
public function setBiz(array $biz): void
|
||||
{
|
||||
$this->biz = $biz;
|
||||
}
|
||||
|
||||
private string $username;
|
||||
private ?string $password = null;
|
||||
private bool $state = true;
|
||||
private ?string $fettle = null;
|
||||
|
||||
private string $role = '';
|
||||
|
||||
public function getRole(): string
|
||||
{
|
||||
return $this->role;
|
||||
}
|
||||
|
||||
public function setRole(string $role): void
|
||||
{
|
||||
$this->role = $role;
|
||||
}
|
||||
|
||||
|
||||
public function getUsername(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function setUsername(string $username): void
|
||||
{
|
||||
$this->username = $username;
|
||||
}
|
||||
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): void
|
||||
{
|
||||
$this->password = $password;
|
||||
}
|
||||
|
||||
public function isState(): bool
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
public function setState(bool $state): void
|
||||
{
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
public function getFettle(): string
|
||||
{
|
||||
return $this->fettle;
|
||||
}
|
||||
|
||||
public function setFettle(string $fettle): void
|
||||
{
|
||||
$this->fettle = $fettle;
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user