27 lines
839 B
Python
27 lines
839 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 BreedingPlotModel, BreedingSiteModel
|
|
|
|
|
|
class BreedingSiteCRUD(CRUDBase[BreedingSiteModel, Any, Any]):
|
|
"""基地 CRUD —— 直接复用 CRUDBase(已自动注入数据权限过滤)。"""
|
|
|
|
def __init__(self, auth: AuthSchema, db: AsyncSession) -> None:
|
|
super().__init__(BreedingSiteModel, auth, db)
|
|
|
|
|
|
class BreedingPlotCRUD(CRUDBase[BreedingPlotModel, Any, Any]):
|
|
"""试验地 CRUD —— 直接复用 CRUDBase(已自动注入数据权限过滤)。"""
|
|
|
|
def __init__(self, auth: AuthSchema, db: AsyncSession) -> None:
|
|
super().__init__(BreedingPlotModel, auth, db)
|
|
|
|
|
|
site_crud = BreedingSiteCRUD
|
|
plot_crud = BreedingPlotCRUD
|