13 lines
495 B
Python
13 lines
495 B
Python
from typing import Optional
|
|
from sqlalchemy.orm import Session
|
|
from mooc.crud.crud_base import CRUDBase
|
|
from mooc.models.custom_reply import CustomReply
|
|
from mooc.schemas.custom_reply import CustomReplyCreate, CustomReplyUpdate
|
|
|
|
class CRUDCustomReply(CRUDBase[CustomReply, CustomReplyCreate, CustomReplyUpdate]):
|
|
def get_by_id(self, db: Session, *, id: int) -> Optional[CustomReply]:
|
|
return self.get_by_field(db, "id", id)
|
|
|
|
# 创建实例
|
|
custom_reply = CRUDCustomReply(CustomReply)
|