From 284cf328809eedb419a7695081d54fa483e7a938 Mon Sep 17 00:00:00 2001 From: "M307 (Mac)" Date: Sat, 19 Nov 2022 12:36:05 +0700 Subject: [PATCH] Fix type dosen't not show --- enkanetwork/client.py | 2 +- enkanetwork/model/__init__.py | 5 ----- enkanetwork/model/base.py | 12 ++++++++++++ 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 enkanetwork/model/base.py diff --git a/enkanetwork/client.py b/enkanetwork/client.py index c1e9991..205d566 100644 --- a/enkanetwork/client.py +++ b/enkanetwork/client.py @@ -6,7 +6,7 @@ import logging import warnings from .http import HTTPClient -from .model import EnkaNetworkResponse +from .model.base import EnkaNetworkResponse from .assets import Assets from .enum import Language from .cache import Cache diff --git a/enkanetwork/model/__init__.py b/enkanetwork/model/__init__.py index d2a7a16..024b000 100644 --- a/enkanetwork/model/__init__.py +++ b/enkanetwork/model/__init__.py @@ -6,8 +6,3 @@ from .character import * from .equipments import * from .players import * from .stats import * - -class EnkaNetworkResponse(BaseModel): - player: PlayerInfo = Field(None, alias="playerInfo") - characters: List[CharacterInfo] = Field(None, alias="avatarInfoList") - ttl: int = 0 diff --git a/enkanetwork/model/base.py b/enkanetwork/model/base.py new file mode 100644 index 0000000..137bad7 --- /dev/null +++ b/enkanetwork/model/base.py @@ -0,0 +1,12 @@ +from pydantic import BaseModel, Field +from typing import List + +from .players import PlayerInfo +from .character import CharacterInfo + +__all__ = ("EnkaNetworkResponse",) + +class EnkaNetworkResponse(BaseModel): + player: PlayerInfo = Field(None, alias="playerInfo") + characters: List[CharacterInfo] = Field(None, alias="avatarInfoList") + ttl: int = 0 \ No newline at end of file