mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Init
This commit is contained in:
42
fastapi_book_server/app/serializers/book.py
Normal file
42
fastapi_book_server/app/serializers/book.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from datetime import date
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.serializers.author import Author
|
||||
|
||||
|
||||
class Book(BaseModel):
|
||||
id: int
|
||||
title: str
|
||||
lang: str
|
||||
file_type: str
|
||||
uploaded: date
|
||||
authors: list[Author]
|
||||
|
||||
|
||||
class CreateBook(BaseModel):
|
||||
source: int
|
||||
remote_id: int
|
||||
title: str
|
||||
lang: str
|
||||
file_type: str
|
||||
uploaded: date
|
||||
authors: list[int]
|
||||
|
||||
|
||||
class UpdateBook(BaseModel):
|
||||
title: str
|
||||
lang: str
|
||||
file_type: str
|
||||
uploaded: date
|
||||
authors: list[int]
|
||||
|
||||
|
||||
class CreateRemoteBook(BaseModel):
|
||||
source: int
|
||||
remote_id: int
|
||||
title: str
|
||||
lang: str
|
||||
file_type: str
|
||||
uploaded: date
|
||||
remote_authors: list[int]
|
||||
Reference in New Issue
Block a user