优化更新
This commit is contained in:
@@ -73,6 +73,9 @@ position_service = PositionService()
|
||||
| `serialize_maps` | dict | 枚举显示名映射 | `{'status': {1: '在用', 2: '停用'}}` |
|
||||
| `file_fields` | tuple | 文件字段 | `('cover', 'image')` |
|
||||
| `rich_text_fields` | tuple | 富文本字段 | `('content',)` |
|
||||
| `file_dir` | str | 文件存储子目录名 | 默认从表名去掉 `DB_PREFIX` 推导 |
|
||||
| `serialize_extra` | Callable | 列表/详情共用序列化钩子,返回需合并进字典的额外字段 | — |
|
||||
| `detail_serialize` | Callable | 详情专用序列化钩子,仅在 `get_detail` 时合并 | — |
|
||||
|
||||
:::tip 单例模式
|
||||
每个模块在文件末尾创建 Service 实例(如 `position_service`),供 Endpoint 层使用。
|
||||
|
||||
Reference in New Issue
Block a user