mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2026-03-03 23:20:52 +01:00
Refactoring
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from typing import Optional
|
||||
from datetime import date
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.serializers.orjson_config import ORJSONConfig
|
||||
@@ -18,3 +20,28 @@ class CreateSequence(BaseModel):
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class Author(BaseModel):
|
||||
id: int
|
||||
|
||||
first_name: str
|
||||
last_name: str
|
||||
middle_name: Optional[str]
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
|
||||
class Book(BaseModel):
|
||||
id: int
|
||||
title: str
|
||||
lang: str
|
||||
file_type: str
|
||||
available_types: list[str]
|
||||
uploaded: date
|
||||
authors: list[Author]
|
||||
annotation_exists: bool
|
||||
|
||||
class Config(ORJSONConfig):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user