🔧 修改 Cookie 写入到数据库的声明类型

This commit is contained in:
洛水居室 2022-08-05 20:11:46 +08:00
parent 5eb741070d
commit e5890201a3
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ class CookiesRepository:
def __init__(self, mysql: MySQL):
self.mysql = mysql
async def add_cookies(self, user_id: int, cookies: str, region: RegionEnum):
async def add_cookies(self, user_id: int, cookies: dict, region: RegionEnum):
async with self.mysql.Session() as session:
session = cast(AsyncSession, session)
if region == RegionEnum.HYPERION:
@ -25,7 +25,7 @@ class CookiesRepository:
await session.add(db_data)
await session.commit()
async def update_cookies(self, user_id: int, cookies: str, region: RegionEnum):
async def update_cookies(self, user_id: int, cookies: dict, region: RegionEnum):
async with self.mysql.Session() as session:
session = cast(AsyncSession, session)
if region == RegionEnum.HYPERION:

View File

@ -14,10 +14,10 @@ class CookiesService:
def __init__(self, cookies_repository: CookiesRepository) -> None:
self._repository: CookiesRepository = cookies_repository
async def update_cookies(self, user_id: int, cookies: str, region: RegionEnum):
async def update_cookies(self, user_id: int, cookies: dict, region: RegionEnum):
await self._repository.update_cookies(user_id, cookies, region)
async def add_cookies(self, user_id: int, cookies: str, region: RegionEnum):
async def add_cookies(self, user_id: int, cookies: dict, region: RegionEnum):
await self._repository.add_cookies(user_id, cookies, region)
async def get_cookies(self, user_id: int, region: RegionEnum):