2025-03-04 20:36:52 +08:00
|
|
|
from typing import Optional
|
2025-01-05 21:09:26 +08:00
|
|
|
from sqlalchemy.orm import Session
|
2025-03-04 20:36:52 +08:00
|
|
|
from mooc.crud.crud_base import CRUDBase
|
2025-03-05 20:56:27 +08:00
|
|
|
from mooc.models.images_reply import ImagesReply
|
|
|
|
from mooc.schemas.images_reply import ImagesReplyCreate, ImagesReplyUpdate
|
2025-01-05 21:09:26 +08:00
|
|
|
|
2025-03-04 20:36:52 +08:00
|
|
|
class CRUDImagesReply(CRUDBase[ImagesReply, ImagesReplyCreate, ImagesReplyUpdate]):
|
|
|
|
def get_by_id(self, db: Session, *, id: int) -> Optional[ImagesReply]:
|
|
|
|
return self.get_by_field(db, "id", id)
|
2025-01-05 21:09:26 +08:00
|
|
|
|
2025-03-04 20:36:52 +08:00
|
|
|
# 创建实例
|
|
|
|
images_reply = CRUDImagesReply(ImagesReply)
|