23 lines
656 B
Python
23 lines
656 B
Python
from typing import Any
|
|
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.core.base_crud import CRUDBase
|
|
from app.core.base_schema import AuthSchema
|
|
|
|
from .model import BreedingGermplasmModel
|
|
|
|
|
|
class BreedingGermplasmCRUD(CRUDBase[BreedingGermplasmModel, Any, Any]):
|
|
"""亲本资源 CRUD —— 直接复用 CRUDBase。
|
|
|
|
CRUDBase._build_conditions 已自动注入数据权限过滤
|
|
(app.core.permission.Permission),无需在 Service 层手动处理 IDOR。
|
|
"""
|
|
|
|
def __init__(self, auth: AuthSchema, db: AsyncSession) -> None:
|
|
super().__init__(BreedingGermplasmModel, auth, db)
|
|
|
|
|
|
germplasm_crud = BreedingGermplasmCRUD
|