38 lines
635 B
Python
38 lines
635 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
from typing import List
|
|
|
|
|
|
class QuestionRequest(BaseModel):
|
|
type: str
|
|
question: str
|
|
options: List[str]
|
|
answer: List[str]
|
|
|
|
|
|
class QuestionResponse(QuestionRequest):
|
|
id: int
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class LibraryFileRequest(BaseModel):
|
|
subject: str
|
|
module: str
|
|
name: str
|
|
size: int
|
|
type: str
|
|
|
|
questions: List[QuestionRequest] = []
|
|
|
|
|
|
class LibraryFileResponse(LibraryFileRequest):
|
|
id: int
|
|
uploadTime: str
|
|
questions: List[QuestionResponse] = []
|
|
|
|
class Config:
|
|
from_attributes = True
|