Compare commits
No commits in common. "b3a5c320c1fcd656e70723c0206e79bcae1eb529" and "8d17cb73abf8cd8613187e24588310af78b3d19f" have entirely different histories.
b3a5c320c1
...
8d17cb73ab
14
README.md
14
README.md
@ -1,11 +1,9 @@
|
|||||||
### 安装
|
### 安装
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
composer require maiyoule/mqttclient_author
|
composer require maiyoule/mqttclient_author
|
||||||
```
|
```
|
||||||
|
|
||||||
### 配置
|
### 配置
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$manager = new MQTTManager();
|
$manager = new MQTTManager();
|
||||||
//设置APPID
|
//设置APPID
|
||||||
@ -16,8 +14,6 @@ $manager->setPrivateKey('');
|
|||||||
|
|
||||||
### 使用
|
### 使用
|
||||||
|
|
||||||
#### 创建
|
|
||||||
|
|
||||||
```php
|
```php
|
||||||
//创建MQTT用户
|
//创建MQTT用户
|
||||||
$request = new AppUserCreateRequest();
|
$request = new AppUserCreateRequest();
|
||||||
@ -37,13 +33,3 @@ $data = $biz->getData();
|
|||||||
//....
|
//....
|
||||||
print_r($data);
|
print_r($data);
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 注销登录
|
|
||||||
```php
|
|
||||||
$request=new \cn\com\maiyoule\mqttclient\biz\AppUserLogoutRequest();
|
|
||||||
$request->setUsername('xxxxx');
|
|
||||||
|
|
||||||
$biz=$manager->exec($request);
|
|
||||||
|
|
||||||
echo sprintf('注销结果:%b',$biz->isSuccess())
|
|
||||||
```
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "maiyoule/mqttclient_author",
|
"name": "maiyoule/mqttclient_author",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "MQTT管理模块操作库",
|
"description": "MQTT管理模块操作库",
|
||||||
"version": "1.0.3",
|
"version": "1.0.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace cn\com\maiyoule\mqttclient\biz;
|
|
||||||
|
|
||||||
use cn\com\maiyoule\mqttclient\IRequest;
|
|
||||||
|
|
||||||
class AppUserLogoutRequest extends IRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
public function path(): string
|
|
||||||
{
|
|
||||||
|
|
||||||
return 'mqtt/user/kick';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function body(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'username' => $this->getUsername()
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private string $username;
|
|
||||||
|
|
||||||
public function getUsername(): string
|
|
||||||
{
|
|
||||||
return $this->username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setUsername(string $username): void
|
|
||||||
{
|
|
||||||
$this->username = $username;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user