提交 ef09e957 编写于 作者: 如梦技术's avatar 如梦技术 🐛

梳理文档。

上级 daf17eae
......@@ -42,9 +42,9 @@
| Name | Type | Required | Default | Description |
| -------- | ------- | -------- | ------- | ----------------------------------------------------------- |
| topic | String | Optional | | 主题,与 `topics` 至少指定其中之一 |
| clientid | String | Required | | 客户端标识符 |
| payload | String | Required | | 消息正文 |
| topic | String | Required | | 主题 |
| clientId | String | Required | | 客户端标识符 |
| payload | String | Required | | 消息正文 |
| encoding | String | Optional | plain | 消息正文使用的编码方式,目前仅支持 目前仅支持 `plain``hex``base64` |
| qos | Integer | Optional | 0 | QoS 等级 |
| retain | Boolean | Optional | false | 是否为保留消息 |
......@@ -58,7 +58,7 @@
**Examples:**
```bash
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/publish" -d '{"topic":"a/b/c","payload":"Hello World","qos":1,"retain":false,"clientid":"example"}'
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/publish" -d '{"topic":"a/b/c","payload":"Hello World","qos":1,"retain":false,"clientId":"example"}'
{"code":0}
......@@ -75,8 +75,8 @@ Copied!
| Name | Type | Required | Default | Description |
| -------- | ------- | -------- | ------- | ----------------------------------------------------- |
| topic | String | Optional | | 主题,与 `topics` 至少指定其中之一 |
| clientid | String | Required | | 客户端标识符 |
| topic | String | Required | | 主题 |
| clientId | String | Required | | 客户端标识符 |
| qos | Integer | Optional | 0 | QoS 等级 |
**Success Response Body (JSON):**
......@@ -90,7 +90,7 @@ Copied!
同时订阅 `a`, `b`, `c` 三个主题
```bash
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/subscribe" -d '{"topics":"a,b,c","qos":1,"clientid":"example"}'
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/subscribe" -d '{"topic":"a/b/c","qos":1,"clientId":"example"}'
{"code":0}
......@@ -106,7 +106,7 @@ Copied!
| Name | Type | Required | Default | Description |
| -------- | ------ | -------- | ------- | ------------ |
| topic | String | Required | | 主题 |
| clientid | String | Required | | 客户端标识符 |
| clientId | String | Required | | 客户端标识符 |
**Success Response Body (JSON):**
......@@ -119,7 +119,7 @@ Copied!
取消订阅 `a` 主题
```bash
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/unsubscribe" -d '{"topic":"a","qos":1,"clientid":"example"}'
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/unsubscribe" -d '{"topic":"a","qos":1,"clientId":"example"}'
{"code":0}
......@@ -136,8 +136,8 @@ Copied!
| Name | Type | Required | Default | Description |
| ------------ | ------- | -------- | ------- | ----------------------------------------------------------- |
| [0].topic | String | Optional | | 主题,与 `topics` 至少指定其中之一 |
| [0].clientid | String | Required | | 客户端标识符 |
| [0].topic | String | Required | | 主题 |
| [0].clientId | String | Required | | 客户端标识符 |
| [0].payload | String | Required | | 消息正文 |
| [0].encoding | String | Optional | plain | 消息正文使用的编码方式,目前仅支持 `plain``hex``base64` |
| [0].qos | Integer | Optional | 0 | QoS 等级 |
......@@ -152,7 +152,7 @@ Copied!
**Examples:**
```bash
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/publish/batch" -d '[{"topic":"a/b/c","payload":"Hello World","qos":1,"retain":false,"clientid":"example"},{"topic":"a/b/c","payload":"Hello World Again","qos":0,"retain":false,"clientid":"example"}]'
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/publish/batch" -d '[{"topic":"a/b/c","payload":"Hello World","qos":1,"retain":false,"clientId":"example"},{"topic":"a/b/c","payload":"Hello World Again","qos":0,"retain":false,"clientId":"example"}]'
{"code":0}
......@@ -169,8 +169,8 @@ Copied!
| Name | Type | Required | Default | Description |
| ------------ | ------- | -------- | ------- | ----------------------------------------------------- |
| [0].topic | String | Optional | | 主题,与 `topics` 至少指定其中之一 |
| [0].clientid | String | Required | | 客户端标识符 |
| [0].topic | String | Required | | 主题 |
| [0].clientId | String | Required | | 客户端标识符 |
| [0].qos | Integer | Optional | 0 | QoS 等级 |
**Success Response Body (JSON):**
......@@ -184,7 +184,7 @@ Copied!
一次性订阅 `a`, `b`, `c` 三个主题
```bash
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/subscribe/batch" -d '[{"topic":"a","qos":1,"clientid":"example"},{"topic":"b","qos":1,"clientid":"example"},{"topic":"c","qos":1,"clientid":"example"}]'
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/subscribe/batch" -d '[{"topic":"a","qos":1,"clientId":"example"},{"topic":"b","qos":1,"clientId":"example"},{"topic":"c","qos":1,"clientId":"example"}]'
{"code":0}
......@@ -200,7 +200,7 @@ Copied!
| Name | Type | Required | Default | Description |
| ------------ | ------ | -------- | ------- | ------------ |
| [0].topic | String | Required | | 主题 |
| [0].clientid | String | Required | | 客户端标识符 |
| [0].clientId | String | Required | | 客户端标识符 |
**Success Response Body (JSON):**
......@@ -213,7 +213,7 @@ Copied!
一次性取消订阅 `a`, `b` 主题
```bash
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/unsubscribe/batch" -d '[{"topic":"a","qos":1,"clientid":"example"},{"topic":"b","qos":1,"clientid":"example"}]'
$ curl -i --basic -u mica:mica -X POST "http://localhost:8083/api/v1/mqtt/unsubscribe/batch" -d '[{"topic":"a","qos":1,"clientId":"example"},{"topic":"b","qos":1,"clientId":"example"}]'
{"code":0}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册