mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-26 06:19:04 +00:00
1. 重构后端API路由、CRUD与模块结构,整合日志管理,移除废弃demo代码 2. 优化前端组件类型定义、样式与路由配置,修复权限判断逻辑 3. 调整默认排序规则、滚动条样式与工具类函数,更新依赖与配置文件 4. 修复多处类型不匹配与默认值问题,完善表单与菜单验证逻辑
17 lines
633 B
Python
17 lines
633 B
Python
"""发票管理 CRUD"""
|
|
from app.core.base_crud import CRUDBase
|
|
from app.core.base_schema import AuthSchema
|
|
|
|
from .model import InvoiceModel
|
|
from .schema import InvoiceCreateSchema, InvoiceUpdateSchema
|
|
|
|
|
|
class InvoiceCRUD(CRUDBase[InvoiceModel, InvoiceCreateSchema, InvoiceUpdateSchema]):
|
|
"""发票 CRUD —— 继承 CRUDBase 获得增删改查、软删除过滤、租户隔离、权限过滤"""
|
|
|
|
def __init__(self, auth: AuthSchema) -> None:
|
|
super().__init__(model=InvoiceModel, auth=auth)
|
|
|
|
async def get_by_order_id(self, order_id: int) -> InvoiceModel | None:
|
|
return await self.get(order_id=order_id)
|