Async release
This commit is contained in:
17
app/controllers/abc/__init__.py
Normal file
17
app/controllers/abc/__init__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from .level import ILevelController
|
||||
from .listening import IListeningController
|
||||
from .reading import IReadingController
|
||||
from .writing import IWritingController
|
||||
from .speaking import ISpeakingController
|
||||
from .grade import IGradeController
|
||||
from .training import ITrainingController
|
||||
|
||||
__all__ = [
|
||||
"IListeningController",
|
||||
"IReadingController",
|
||||
"IWritingController",
|
||||
"ISpeakingController",
|
||||
"ILevelController",
|
||||
"IGradeController",
|
||||
"ITrainingController"
|
||||
]
|
||||
26
app/controllers/abc/grade.py
Normal file
26
app/controllers/abc/grade.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class IGradeController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def grade_writing_task(self, task: int, data):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def grade_speaking_task(self, task: int, data: Dict):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def grading_summary(self, data: Dict):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def _grade_speaking_task_1_2(self, task: int, question: str, answer_firebase_path: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def _grade_speaking_task3(self, answers: Dict):
|
||||
pass
|
||||
|
||||
12
app/controllers/abc/level.py
Normal file
12
app/controllers/abc/level.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class ILevelController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_level_exam(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_level_utas(self):
|
||||
pass
|
||||
13
app/controllers/abc/listening.py
Normal file
13
app/controllers/abc/listening.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List
|
||||
|
||||
|
||||
class IListeningController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_listening_question(self, section_id: int, topic: str, exercises: List[str], difficulty: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def save_listening(self, data):
|
||||
pass
|
||||
10
app/controllers/abc/reading.py
Normal file
10
app/controllers/abc/reading.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List
|
||||
|
||||
|
||||
class IReadingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_reading_passage(self, passage: int, topic: str, exercises: List[str], difficulty: str):
|
||||
pass
|
||||
|
||||
21
app/controllers/abc/speaking.py
Normal file
21
app/controllers/abc/speaking.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from fastapi import BackgroundTasks
|
||||
|
||||
|
||||
class ISpeakingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_speaking_task(self, task: int, topic: str, difficulty: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def save_speaking(self, data, background_tasks: BackgroundTasks):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_speaking_video(self, data):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_interactive_video(self, data):
|
||||
pass
|
||||
8
app/controllers/abc/training.py
Normal file
8
app/controllers/abc/training.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class ITrainingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def fetch_tips(self, data):
|
||||
pass
|
||||
8
app/controllers/abc/writing.py
Normal file
8
app/controllers/abc/writing.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class IWritingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_writing_task_general_question(self, task: int, topic: str, difficulty: str):
|
||||
pass
|
||||
Reference in New Issue
Block a user