dsh-apis-plugin 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,27 +13,33 @@ dsh plugin --profile web add dsh-apis-plugin
|
|
|
13
13
|
安装后重启 `dsh web` 生效。指定版本:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
dsh plugin --profile web add dsh-apis-plugin@0.1.
|
|
16
|
+
dsh plugin --profile web add dsh-apis-plugin@0.1.6
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 配置
|
|
20
20
|
|
|
21
|
+
建议把 `api.cfg` 和 `api_doc.md` 一起放在同一个目录下(如项目的 `config/` 目录),然后在插件配置页把「API配置」指向该目录:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
config/
|
|
25
|
+
├── api.cfg # 接口清单
|
|
26
|
+
└── api_doc.md # 接口文档
|
|
27
|
+
```
|
|
28
|
+
|
|
21
29
|
### 1. api.cfg(接口清单,必需)
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
key=value 行格式,`#` 注释,UTF-8 编码:
|
|
24
32
|
|
|
25
33
|
```ini
|
|
26
34
|
# 接口服务前缀:域名 + nginx 前缀 + 网关路由段
|
|
27
35
|
baseUrl=http://your-host/prod-api
|
|
28
36
|
|
|
29
|
-
#
|
|
30
|
-
apis=/users/page,/users/{id}
|
|
31
|
-
|
|
32
|
-
# 或逐行列举
|
|
37
|
+
# 接口列表:apis= 下面逐行一个接口
|
|
33
38
|
apis=
|
|
39
|
+
/users/page
|
|
40
|
+
/users/{id}
|
|
34
41
|
/outline/page
|
|
35
42
|
/outline/detailByNos
|
|
36
|
-
/basicTargetChar/item/listByTargetCharId
|
|
37
43
|
```
|
|
38
44
|
|
|
39
45
|
- `baseUrl`:请求时拼接在接口路径前(改文件即生效,无需重启)
|
|
@@ -42,7 +48,7 @@ apis=
|
|
|
42
48
|
|
|
43
49
|
### 2. api_doc.md(接口文档,建议提供)
|
|
44
50
|
|
|
45
|
-
与 `api.cfg`
|
|
51
|
+
与 `api.cfg` 放在一起。用 `---` 分节,每节描述一个接口,节内用反引号标注接口路径:
|
|
46
52
|
|
|
47
53
|
```markdown
|
|
48
54
|
## 通用说明
|