refactor: mixins for services
This commit is contained in:
21
schemas/base_crud.py
Normal file
21
schemas/base_crud.py
Normal file
@ -0,0 +1,21 @@
|
||||
from typing import TypeVar
|
||||
|
||||
from schemas.base import BaseResponse, BaseSchema
|
||||
|
||||
SchemaType = TypeVar("SchemaType", bound=BaseSchema)
|
||||
|
||||
|
||||
class BaseGetAllResponse[SchemaType](BaseSchema):
|
||||
items: list[SchemaType]
|
||||
|
||||
|
||||
class BaseCreateResponse[SchemaType](BaseResponse):
|
||||
entity: SchemaType
|
||||
|
||||
|
||||
class BaseUpdateResponse(BaseResponse):
|
||||
pass
|
||||
|
||||
|
||||
class BaseDeleteResponse(BaseResponse):
|
||||
pass
|
||||
Reference in New Issue
Block a user