File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,15 @@ mvc 架构作为常规设计模式,在 python web 中很常见,但是三层
66
66
- admin 系统后台
67
67
- api/ 接口
68
68
- crud/ CRUD
69
- - model/ 模型
69
+ - model 模型
70
+ - \_\_ init__ .py 必须在此文件内导入所有模型类
71
+ - …
70
72
- schema/ 数据传输
71
73
- service/ 服务
72
74
- tests/ 单元测试
73
75
- generator/ 代码生成
74
76
- task/ 任务
75
- - ...
77
+ - …
76
78
- common/ 公共资源
77
79
- core/ 核心配置
78
80
- database/ 数据库连接
@@ -85,7 +87,7 @@ mvc 架构作为常规设计模式,在 python web 中很常见,但是三层
85
87
- templates/ 模版文件
86
88
- utils/ 工具包
87
89
- deploy/ 服务器部署
88
- - ...
90
+ - …
89
91
90
92
:::
91
93
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ title: 插件开发
35
35
- xxx 插件名
36
36
- api/ 接口,务必查看下方【插件接口附加说明】
37
37
- crud/ CRUD
38
- - model/ 模型
38
+ - model 模型
39
+ - \_\_ init__ .py 必须在此文件内导入所有模型类
40
+ - …
39
41
- schema/ 数据传输
40
42
- service/ 服务
41
43
- \_\_ init__ .py 作为 python 包保留(必填项)
@@ -50,7 +52,8 @@ title: 插件开发
50
52
51
53
- 如果插件作为独立 app 发布(在 ` backend/app ` 目录下的应用,视为独立
52
54
app),则插件路由应完全遵循 [ 路由结构] ( ../guide/reference/router.md#路由结构 ) 进行定义
53
- - 如果插件作为现有 app 扩展功能发布,则插件路由应当根据现有 app 中的路由结构进行 1:1 结构复制,插件路由将按结构自动注入,可参考 fba
55
+ - 如果插件作为现有 app 扩展功能发布,则插件路由应当根据现有 app 中的路由结构进行 1:1 结构复制,插件路由将按结构自动注入,可参考
56
+ fba
54
57
源码中的内置插件 [ notice] ( https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend/plugin/notice/api )
55
58
56
59
:::
You can’t perform that action at this time.
0 commit comments