mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Use orjson in serializers
This commit is contained in:
@@ -3,6 +3,7 @@ from datetime import date
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.serializers.author import Author
|
||||
from app.serializers.orjson_config import ORJSONConfig
|
||||
|
||||
|
||||
class Book(BaseModel):
|
||||
@@ -14,6 +15,9 @@ class Book(BaseModel):
|
||||
uploaded: date
|
||||
authors: list[Author]
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class CreateBook(BaseModel):
|
||||
source: int
|
||||
@@ -24,6 +28,9 @@ class CreateBook(BaseModel):
|
||||
uploaded: date
|
||||
authors: list[int]
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class UpdateBook(BaseModel):
|
||||
title: str
|
||||
@@ -32,6 +39,9 @@ class UpdateBook(BaseModel):
|
||||
uploaded: date
|
||||
authors: list[int]
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class CreateRemoteBook(BaseModel):
|
||||
source: int
|
||||
@@ -41,3 +51,6 @@ class CreateRemoteBook(BaseModel):
|
||||
file_type: str
|
||||
uploaded: date
|
||||
remote_authors: list[int]
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user