@@ -4,25 +4,17 @@ title: 插件开发
44
55## 后端
66
7- :::: steps
7+ ::: steps
88
991 . 拉取最新的 fba 项目到本地并配置好开发环境
10102 . 通过 [ 插件分类] ( #插件分类 ) 、[ 插件路由结构] ( #插件路由结构 ) 、[ 插件配置] ( #插件配置 ) 、[ 数据库兼容性] ( #数据库兼容性 )
1111 了解插件系统的运作机制
12123 . 根据 [ 插件目录结构] ( #插件目录结构 ) 进行插件开发
13134 . 完成插件开发
14- 5 . 插件分享 <Badge type =" warning " text =" 可选 " />
1514
16- 使用插件模板仓库 [ fba_plugin_template] ( https://github.com/fastapi-practices/fba_plugin_template )
17- 创建个人仓库,并将插件代码上传到个人仓库
15+ 5 . [ 插件分享] ( ./share.md ) <Badge type =" warning " text =" 可选 " />
1816
19- ::: warning
20- 请不要将插件代码以 PR 的方式进行提交!
21- :::
22-
23- 6 . [ 申请发布插件] ( publish.md ) <Badge type =" warning " text =" 可选 " />
24-
25- ::::
17+ :::
2618
2719### 插件分类
2820
@@ -92,25 +84,26 @@ fba 内所有官方实现都同时兼容 mysql 和 postgresql,但我们不对
9284
9385### 插件目录结构
9486
87+ 插件统一放置在 ` backend/plugin ` 目录下,以下是插件的目录结构
88+
9589::: file-tree
9690
97- - backend 固定目录 <Badge type =" danger " text =" 必须 " />
98- - plugin 固定目录 <Badge type =" danger " text =" 必须 " />
99- - xxx 插件名 <Badge type =" danger " text =" 必须 " />
100- - api/ 接口 <Badge type =" danger " text =" 必须 " />
101- - crud/ CRUD <Badge type =" warning " text =" 非必须 " />
102- - model 模型 <Badge type =" warning " text =" 非必须 " />
103- - __ init__ .py 在此文件内导入所有模型类 <Badge type =" danger " text =" 必须 " />
104- - …
105- - schema/ 数据传输 <Badge type =" warning " text =" 非必须 " />
106- - service/ 服务 <Badge type =" warning " text =" 非必须 " />
107- - utils/ 工具包 <Badge type =" warning " text =" 非必须 " />
108- - __ init__ .py 作为 python 包保留 <Badge type =" danger " text =" 必须 " />
109- - conf.py 插件独立配置 <Badge type =" warning " text =" 非必须 " />
110- - … 更多其他配置,例如 enums.py... <Badge type =" warning " text =" 非必须 " />
111- - plugin.toml 插件配置文件 <Badge type =" danger " text =" 必须 " />
112- - README.md 插件使用说明 <Badge type =" danger " text =" 必须 " />
113- - requirements.txt 依赖包文件 <Badge type =" warning " text =" 非必须 " />
91+ - xxx 插件名 <Badge type =" danger " text =" 必须 " />
92+ - api/ 接口 <Badge type =" danger " text =" 必须 " />
93+ - crud/ CRUD <Badge type =" warning " text =" 非必须 " />
94+ - model 模型 <Badge type =" warning " text =" 非必须 " />
95+ - __ init__ .py 在此文件内导入所有模型类 <Badge type =" danger " text =" 必须 " />
96+ - …
97+ - schema/ 数据传输 <Badge type =" warning " text =" 非必须 " />
98+ - service/ 服务 <Badge type =" warning " text =" 非必须 " />
99+ - utils/ 工具包 <Badge type =" warning " text =" 非必须 " />
100+ - __ init__ .py 作为 python 包保留 <Badge type =" danger " text =" 必须 " />
101+ - .env.example 插件环境变量配置示例 <Badge type =" warning " text =" 非必须 " />
102+ - conf.py.example 插件独立配置示例 <Badge type =" warning " text =" 非必须 " />
103+ - … 更多其他配置,例如 enums.py... <Badge type =" warning " text =" 非必须 " />
104+ - plugin.toml 插件配置文件 <Badge type =" danger " text =" 必须 " />
105+ - README.md 插件使用说明和您的联系方式 <Badge type =" danger " text =" 必须 " />
106+ - requirements.txt 依赖包文件 <Badge type =" warning " text =" 非必须 " />
114107
115108:::
116109
0 commit comments