refactor: args

This commit is contained in:
Dan Chen
2024-03-21 15:20:09 +08:00
parent 49659dcc13
commit 726b926d98
6 changed files with 22 additions and 13 deletions

View File

@ -7,10 +7,12 @@ from .blackbox import Blackbox
class SUM(Blackbox):
def valid(self, data: any) -> bool:
def valid(self, *args, **kwargs) -> bool:
data = args[0]
return isinstance(data, list)
def processing(self, data: list) -> Coroutine[Any, Any, Any]:
def processing(self, *args, **kwargs) -> Coroutine[Any, Any, Any]:
data = args[0]
return sum(data)
async def fast_api_handler(self, request: Request) -> Response: