mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 21:06:32 +00:00
- 重构API路由与请求路径,统一批量状态更新接口 - 优化类型导入与参数继承逻辑,简化基础查询参数实现 - 修复日志格式化与权限校验细节问题 - 新增多模块接口测试用例,完善测试覆盖 - 调整环境配置与初始化脚本细节 - 简化服务层方法命名,统一代码风格
20 lines
627 B
Django/Jinja
20 lines
627 B
Django/Jinja
# -*- coding: utf-8 -*-
|
|
|
|
from app.core.base_crud import CRUDBase
|
|
from app.core.base_schema import AuthSchema
|
|
from .model import {{ class_name }}Model
|
|
from .schema import {{ class_name }}CreateSchema, {{ class_name }}UpdateSchema
|
|
|
|
|
|
class {{ class_name }}CRUD(CRUDBase[{{ class_name }}Model, {{ class_name }}CreateSchema, {{ class_name }}UpdateSchema]):
|
|
"""{{ function_name }}数据层"""
|
|
|
|
def __init__(self, auth: AuthSchema) -> None:
|
|
"""
|
|
初始化CRUD数据层
|
|
|
|
参数:
|
|
- auth (AuthSchema): 认证信息模型
|
|
"""
|
|
super().__init__(model={{ class_name }}Model, auth=auth)
|