feat:更新练习题接口
This commit is contained in:
@@ -1,19 +1,4 @@
|
||||
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):
|
||||
@@ -24,13 +9,10 @@ class LibraryFileRequest(BaseModel):
|
||||
type: str
|
||||
content: str
|
||||
|
||||
questions: List[QuestionRequest] = []
|
||||
|
||||
|
||||
class LibraryFileResponse(LibraryFileRequest):
|
||||
id: int
|
||||
uploadTime: str
|
||||
questions: List[QuestionResponse] = []
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
Reference in New Issue
Block a user