🐛 fix starrail wish model

This commit is contained in:
xtaodada 2023-05-26 22:32:08 +08:00
parent 7671198c0c
commit 842ad515cd
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import logging
import uuid
from types import TracebackType
from typing import AsyncContextManager, Type, Optional, Any
from typing import AsyncContextManager, Type, Optional, Any, Union
from httpx import AsyncClient, TimeoutException, Response, HTTPError, Timeout
@ -53,7 +53,7 @@ class BaseClient(AsyncContextManager["BaseClient"]):
def __init__(
self,
cookies: Optional[str, CookieTypes] = None,
cookies: Optional[Union[str, CookieTypes]] = None,
headers: Optional[HeaderTypes] = None,
account_id: Optional[int] = None,
player_id: Optional[int] = None,

View File

@ -102,7 +102,7 @@ class BaseWishClient(BaseClient):
game=game,
lang=lang,
authkey=authkey,
params=dict(gacha_type=banner_type, size=size, end_id=end_id, game_biz=Game.value),
params=dict(gacha_type=banner_type, size=size, end_id=end_id, game_biz=game.value),
)
async def get_banner_names(

View File

@ -35,6 +35,9 @@ class StarRailWish(APIModel):
type: str = Field(alias="item_type")
"""Type of the wished item."""
item_id: int = Field(alias="item_id")
"""ID of the wished item."""
name: str
"""Name of the wished item."""
@ -44,6 +47,9 @@ class StarRailWish(APIModel):
time: datetime
"""Time when the wish was made."""
banner_id: int = Field(alias="gacha_id")
"""ID of the banner the wish was made on."""
banner_type: StarRailBannerType = Field(alias="gacha_type")
"""Type of the banner the wish was made on."""