File tree Expand file tree Collapse file tree 1 file changed +30
-16
lines changed Expand file tree Collapse file tree 1 file changed +30
-16
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ title: 插件开发
26
26
27
27
::::
28
28
29
+ ### APP 说明
30
+
31
+ - 独立 app
32
+
33
+ 在 ` backend/app ` 目录下的应用(admin、task...),视为独立 app
34
+
35
+ - 非独立 app
36
+
37
+ 现有 app 的扩展功能
38
+
29
39
### 插件目录结构
30
40
31
41
::: file-tree
@@ -51,19 +61,32 @@ title: 插件开发
51
61
52
62
### 插件接口
53
63
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 )
58
72
59
73
### 插件路由
60
74
61
- 如果插件符合插件开发的要求,则插件的所有路由都将自动注入到 FastAPI 应用中,无需任何其他操作,但值得注意的是,启动时间可能会随着插件数量的递增而增加,因为
75
+ 如果插件符合插件开发的要求,则插件中的所有路由都将自动注入到 FastAPI 应用中,无需任何其他操作,但值得注意的是,启动时间可能会随着插件数量的递增而增加,因为
62
76
fba 会在启动前对所有插件进行解析
63
77
64
78
### 插件配置
65
79
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
+ ```
67
90
68
91
- 非独立 app
69
92
@@ -84,15 +107,6 @@ fba 会在启动前对所有插件进行解析
84
107
tags = ' '
85
108
```
86
109
87
- - 独立 app
88
-
89
- ```toml
90
- # app 配置
91
- [app ]
92
- # 插件路由器版本,默认为 v1(可参考源码 `backend/app/admin/api/router.py`)
93
- router = [' v1' ]
94
- ```
95
-
96
110
# # 前端
97
111
98
- 一旦 [Vben Admin Antd 下一代实施](https://github.com/fastapi-practices/fba_ui) 生产可用,我们将开启此计划 ...
112
+ 暂无此计划 ...
You can’t perform that action at this time.
0 commit comments