Fixed level issues

This commit is contained in:
Carlos-Mesquita
2024-11-10 04:21:36 +00:00
parent cf1b676312
commit 6909d75eb6
15 changed files with 101 additions and 84 deletions

View File

@@ -1,7 +1,7 @@
from abc import ABC, abstractmethod
from fastapi import UploadFile
from typing import Dict
from typing import Dict, Optional
class ILevelController(ABC):
@@ -19,7 +19,7 @@ class ILevelController(ABC):
pass
@abstractmethod
async def upload_level(self, file: UploadFile):
async def upload_level(self, file: UploadFile, solutions: Optional[UploadFile] = None):
pass
@abstractmethod

View File

@@ -19,5 +19,5 @@ class ISpeakingController(ABC):
pass
@abstractmethod
async def pool_video(self, vid_id: str):
async def poll_video(self, vid_id: str):
pass

View File

@@ -1,5 +1,5 @@
from fastapi import UploadFile
from typing import Dict
from typing import Dict, Optional
from watchfiles import awatch
@@ -21,8 +21,8 @@ class LevelController(ILevelController):
async def get_level_utas(self):
return await self._service.get_level_utas()
async def upload_level(self, file: UploadFile):
return await self._service.upload_level(file)
async def upload_level(self, exercises: UploadFile, solutions: Optional[UploadFile] = None):
return await self._service.upload_level(exercises, solutions)
async def get_custom_level(self, data: Dict):
return await self._service.get_custom_level(data)

View File

@@ -22,5 +22,5 @@ class SpeakingController(ISpeakingController):
async def generate_video(self, text: str, avatar: str):
return await self._vid_gen.create_video(text, avatar)
async def pool_video(self, vid_id: str):
return await self._vid_gen.pool_status(vid_id)
async def poll_video(self, vid_id: str):
return await self._vid_gen.poll_status(vid_id)