Added singleton config and changed module structure

This commit is contained in:
2023-11-23 22:13:10 +03:00
parent 6389c4f29e
commit 8c2d706401
12 changed files with 41 additions and 29 deletions

14
neuroapi/_methods/user.py Normal file
View File

@@ -0,0 +1,14 @@
from aiohttp import ClientSession
from .api_method import ApiMethod
class User(ApiMethod):
async def get(self, id: str, username: str):
payload = {'id': id, 'username': username}
async with ClientSession() as session:
response = await session.post(
self.api_url+'/user/get', data=payload)
data = await response.json()
if 'statusCode' in data:
raise Exception(data['message'])