Skip to content

Commit

Permalink
🚨 auto fix by pre-commit-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed May 6, 2024
1 parent b3470f0 commit c9a4eb2
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 23 deletions.
1 change: 1 addition & 0 deletions gsuid_utils/api/akashadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
虚空数据库 API 包装:
深渊出场数据;
"""

from .models import AkashaAbyssData as AkashaAbyssData
from .request import get_akasha_abyss_info as get_akasha_abyss_info

Expand Down
1 change: 1 addition & 0 deletions gsuid_utils/api/akashadata/request.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''
虚空数据库 API 请求模块。
'''

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions gsuid_utils/api/ambr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
角色信息;
武器信息;
"""

from .models import AmbrBook as AmbrBook # noqa: F401
from .models import AmbrWeapon as AmbrWeapon # noqa: F401
from .models import AmbrCharacter as AmbrCharacter # noqa: F401
Expand Down
1 change: 1 addition & 0 deletions gsuid_utils/api/ambr/request.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''
安柏计划 API 请求模块。
'''

from __future__ import annotations

from typing import Dict, Union, Literal, Optional, cast
Expand Down
1 change: 1 addition & 0 deletions gsuid_utils/api/enka/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Enka Network 包装
参考:https://api.enka.network
"""

from .models import EnkaData as EnkaData # noqa: F401
from .request import get_enka_info as get_enka_info # noqa: F401

Expand Down
1 change: 1 addition & 0 deletions gsuid_utils/api/enka/request.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''Enka Network 请求模块。
MiniGG Enka 加速服务在此模块内。
'''

from __future__ import annotations

from typing import Literal
Expand Down
1 change: 1 addition & 0 deletions gsuid_utils/api/hhw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
内鬼网(hhw) API 包装:
深渊出场数据;
"""

from .request import get_abyss_review as get_abyss_review # noqa: F401

__all__ = ["request"]
5 changes: 4 additions & 1 deletion gsuid_utils/api/hhw/request.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''
内鬼网(hhw) API 请求模块。
'''

from __future__ import annotations

from typing import Dict, Union, Optional
Expand Down Expand Up @@ -40,7 +41,9 @@ async def get_abyss_review(
if temp:
abyss_list.append(temp)

for index, half in enumerate(['-1上', '-1下', '-2上', '-2下', '-3上', '-3下']):
for index, half in enumerate(
['-1上', '-1下', '-2上', '-2下', '-3上', '-3下']
):
result[f'{floor}{half}'] = abyss_list[index]

return result
Expand Down
1 change: 1 addition & 0 deletions gsuid_utils/api/minigg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
原神语音;
原神地图;
"""

from .models import Weapon as Weapon # noqa: F401
from .models import WeaponCosts as WeaponCosts # noqa: F401
from .models import WeaponStats as WeaponStats # noqa: F401
Expand Down
23 changes: 19 additions & 4 deletions gsuid_utils/api/minigg/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
MiniGG API 响应模型。
"""

# TODO: - @KimigaiiWuyi 补文档
from __future__ import annotations

Expand Down Expand Up @@ -90,7 +91,9 @@ class Character(TypedDict):
gender: Literal['男', '女']
body: str
association: str
region: Literal['蒙德', '璃月', '稻妻', '须弥', '枫丹', '纳塔', '至冬', '穆纳塔']
region: Literal[
'蒙德', '璃月', '稻妻', '须弥', '枫丹', '纳塔', '至冬', '穆纳塔'
]
affiliation: str
birthdaymmdd: str
birthday: str
Expand Down Expand Up @@ -267,15 +270,27 @@ class EnemyInvest(TypedDict):

class Domain(TypedDict):
name: str
region: Literal['蒙德', '璃月', '稻妻', '须弥', '枫丹', '纳塔', '至冬', '穆纳塔']
region: Literal[
'蒙德', '璃月', '稻妻', '须弥', '枫丹', '纳塔', '至冬', '穆纳塔'
]
domainentrance: str
domaintype: str
description: str
recommendedlevel: int
recommendedelements: List[
Literal['冰元素', '火元素', '雷元素', '水元素', '草元素', '岩元素', '风元素']
Literal[
'冰元素',
'火元素',
'雷元素',
'水元素',
'草元素',
'岩元素',
'风元素',
]
]
daysofweek: List[
Literal['周日', '周一', '周二', '周三', '周四', '周五', '周六']
]
daysofweek: List[Literal['周日', '周一', '周二', '周三', '周四', '周五', '周六']]
unlockrank: int
rewardpreview: List[EnemyReward]
disorder: List[str]
Expand Down
16 changes: 6 additions & 10 deletions gsuid_utils/api/minigg/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
参考:https://blog.minigg.cn/g/18
MiniGG Enka 加速服务不在此模块内。
'''

from __future__ import annotations

import warnings
Expand Down Expand Up @@ -387,36 +388,31 @@ async def get_talent_info(
@overload
async def get_others_info(
type: Literal['foods'], name: str
) -> Union[Food, MiniGGError]:
...
) -> Union[Food, MiniGGError]: ...


@overload
async def get_others_info(
type: Literal['enemies'], name: str
) -> Union[Enemy, MiniGGError]:
...
) -> Union[Enemy, MiniGGError]: ...


@overload
async def get_others_info(
type: Literal['domains'], name: str
) -> Union[Domain, MiniGGError]:
...
) -> Union[Domain, MiniGGError]: ...


@overload
async def get_others_info(
type: Literal['artifacts'], name: str
) -> Union[Artifact, MiniGGError]:
...
) -> Union[Artifact, MiniGGError]: ...


@overload
async def get_others_info(
type: Literal['materials'], name: str
) -> Union[Material, MiniGGError]:
...
) -> Union[Material, MiniGGError]: ...


async def get_others_info(
Expand Down
13 changes: 5 additions & 8 deletions gsuid_utils/api/mys/request.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''
米游社 API 请求模块。
'''

from __future__ import annotations

import copy
Expand Down Expand Up @@ -74,22 +75,18 @@ class MysApi:
proxy_url: Optional[str] = None

@abstractmethod
async def _upass(self, header: Dict):
...
async def _upass(self, header: Dict): ...

@abstractmethod
async def _pass(self, gt: str, ch: str, header: Dict):
...
async def _pass(self, gt: str, ch: str, header: Dict): ...

@abstractmethod
async def get_ck(
self, uid: str, mode: Literal['OWNER', 'RANDOM'] = 'RANDOM'
) -> Optional[str]:
...
) -> Optional[str]: ...

@abstractmethod
async def get_stoken(self, uid: str) -> Optional[str]:
...
async def get_stoken(self, uid: str) -> Optional[str]: ...

async def get_upass_link(self, header: Dict) -> Union[int, Dict]:
header['DS'] = get_ds_token('is_high=false')
Expand Down

0 comments on commit c9a4eb2

Please sign in to comment.