Skip to content

Commit a056749

Browse files
committed
update docs
1 parent 806e4ef commit a056749

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

docs/plugin/dev.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ title: 插件开发
2626

2727
::::
2828

29+
### APP 说明
30+
31+
- 独立 app
32+
33+
`backend/app` 目录下的应用(admin、task...),视为独立 app
34+
35+
- 非独立 app
36+
37+
现有 app 的扩展功能
38+
2939
### 插件目录结构
3040

3141
::: file-tree
@@ -51,19 +61,32 @@ title: 插件开发
5161

5262
### 插件接口
5363

54-
- 如果插件作为独立 app 发布(在 `backend/app` 目录下的应用,视为独立
55-
app),则插件路由应完全遵循 [路由结构](../guide/reference/router.md#路由结构) 进行定义
56-
- 如果插件作为现有 app 扩展功能发布,则插件路由必须根据现有 app 中的路由结构进行 1:1 结构复制,可参考 fba
57-
源码中的内置插件 [notice](https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend/plugin/notice/api)
64+
- 独立 app
65+
66+
插件路由应完全遵循 [路由结构](../guide/reference/router.md#路由结构) 进行定义
67+
68+
- 非独立 app
69+
70+
插件路由必须根据现有 app 中的目录结构进行 1:1 复制,可参考 fba
71+
中的内置插件 [notice](https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend/plugin/notice/api)
5872

5973
### 插件路由
6074

61-
如果插件符合插件开发的要求,则插件的所有路由都将自动注入到 FastAPI 应用中,无需任何其他操作,但值得注意的是,启动时间可能会随着插件数量的递增而增加,因为
75+
如果插件符合插件开发的要求,则插件中的所有路由都将自动注入到 FastAPI 应用中,无需任何其他操作,但值得注意的是,启动时间可能会随着插件数量的递增而增加,因为
6276
fba 会在启动前对所有插件进行解析
6377

6478
### 插件配置
6579

66-
`plugin.toml` 是插件的配置文件,它必须存在,此配置文件根据插件的属性进行定义
80+
`plugin.toml` 是插件的配置文件,它必须存在,此配置文件需根据插件的属性进行定义
81+
82+
- 独立 app
83+
84+
```toml
85+
# app 配置
86+
[app]
87+
# 插件路由器版本,默认为 v1(可参考源码 `backend/app/admin/api/router.py`)
88+
router = ['v1']
89+
```
6790

6891
- 非独立 app
6992

@@ -84,15 +107,6 @@ fba 会在启动前对所有插件进行解析
84107
tags = ''
85108
```
86109

87-
- 独立 app
88-
89-
```toml
90-
# app 配置
91-
[app]
92-
# 插件路由器版本,默认为 v1(可参考源码 `backend/app/admin/api/router.py`)
93-
router = ['v1']
94-
```
95-
96110
## 前端
97111

98-
一旦 [Vben Admin Antd 下一代实施](https://github.com/fastapi-practices/fba_ui) 生产可用,我们将开启此计划...
112+
暂无此计划...

0 commit comments

Comments
 (0)