feat:增加知识库数据接口
This commit is contained in:
37
schemas/library.py
Normal file
37
schemas/library.py
Normal file
@@ -0,0 +1,37 @@
|
||||
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
|
||||
Reference in New Issue
Block a user