diff --git a/jkit/article.py b/jkit/article.py index daa119e..4516b77 100644 --- a/jkit/article.py +++ b/jkit/article.py @@ -119,7 +119,7 @@ def text_content(self) -> str: class ArticleAudioInfo(DataObject, **DATA_OBJECT_CONFIG): id: PositiveInt name: NonEmptyStr - author: NonEmptyStr + producer: NonEmptyStr file_url: str # TODO duration_seconds: PositiveInt file_size_bytes: PositiveInt @@ -349,7 +349,7 @@ async def audio_info(self) -> Optional[ArticleAudioInfo]: return ArticleAudioInfo( id=data["id"], name=data["title"], - author=data["dubber"], # TODO: 命名调整 + producer=data["dubber"], file_url=data["play_url"], duration_seconds=data["duration"], file_size_bytes=data["filesize"], diff --git a/jkit/private/assets.py b/jkit/private/assets.py index 2eefc15..dd48046 100644 --- a/jkit/private/assets.py +++ b/jkit/private/assets.py @@ -38,8 +38,8 @@ class AssetsTransactionRecord(DataObject, **DATA_OBJECT_CONFIG): class FPRewardsRecord(DataObject, **DATA_OBJECT_CONFIG): time: NormalizedDatetime own_amount: Decimal - referral_amount: Decimal - grand_referral_amount: Decimal + level1_referral_amount: Decimal + level2_referral_amount: Decimal total_amount: Decimal @@ -48,7 +48,7 @@ class BenefitCardsInfo(DataObject, **DATA_OBJECT_CONFIG): estimated_benefits_percent: Percentage -class UnsentBenfitCardRecord(DataObject, **DATA_OBJECT_CONFIG): # TODO: 名称更改 +class UnusedBenfitCardRecord(DataObject, **DATA_OBJECT_CONFIG): amount: NonNegativeFloat start_time: NormalizedDatetime end_time: NormalizedDatetime @@ -170,12 +170,12 @@ async def iter_fp_rewards_records( yield FPRewardsRecord( time=normalize_datetime(item["time"]), own_amount=normalize_assets_amount_precise(item["own_reards18"]), - referral_amount=normalize_assets_amount_precise( + level1_referral_amount=normalize_assets_amount_precise( item["referral_rewards18"] ), - grand_referral_amount=normalize_assets_amount_precise( + level2_referral_amount=normalize_assets_amount_precise( item["grand_referral_rewards18"] - ), # TODO: 命名调整 + ), total_amount=normalize_assets_amount_precise( item["total_amount18"] ), @@ -198,9 +198,9 @@ async def benefit_cards_info(self) -> BenefitCardsInfo: ), )._validate() - async def iter_unsent_benefit_cards( # TODO: 名称更改 + async def iter_unused_benefit_cards( self, *, page_count: int = 10 - ) -> AsyncGenerator[UnsentBenfitCardRecord, None]: + ) -> AsyncGenerator[UnusedBenfitCardRecord, None]: now_page = 1 while True: @@ -215,7 +215,7 @@ async def iter_unsent_benefit_cards( # TODO: 名称更改 return for item in data["benefit_cards"]: - yield UnsentBenfitCardRecord( + yield UnusedBenfitCardRecord( amount=float(normalize_assets_amount_precise(item["amount18"])), start_time=normalize_datetime(item["start_time"]), end_time=normalize_datetime(item["end_time"]), @@ -223,7 +223,7 @@ async def iter_unsent_benefit_cards( # TODO: 名称更改 now_page += 1 - async def iter_active_benefit_cards( # TODO: 名称更改 + async def iter_active_benefit_cards( self, *, page_count: int = 10 ) -> AsyncGenerator[ActiveBenfitCardRecord, None]: now_page = 1 @@ -249,7 +249,7 @@ async def iter_active_benefit_cards( # TODO: 名称更改 now_page += 1 - async def iter_expired_benefit_cards( # TODO: 名称更改 + async def iter_expired_benefit_cards( self, *, page_count: int = 10 ) -> AsyncGenerator[ExpiredBenfitCardRecord, None]: now_page = 1 diff --git a/jkit/user.py b/jkit/user.py index 528055d..4b18c14 100644 --- a/jkit/user.py +++ b/jkit/user.py @@ -105,8 +105,8 @@ def to_collection_obj(self) -> "Collection": class UserNotebookInfo(DataObject, **DATA_OBJECT_CONFIG): id: PositiveInt name: NonEmptyStr - is_book: bool # TODO: 命名修改 - is_paid_book: Optional[bool] # TODO: 命名修改 + is_serial: bool + is_paid: Optional[bool] def to_notebook_obj(self) -> "Notebook": from jkit.notebook import Notebook @@ -365,8 +365,8 @@ async def iter_notebooks( yield UserNotebookInfo( id=item["id"], name=item["name"], - is_book=item["book"], - is_paid_book=item.get("paid_book"), + is_serial=item["book"], + is_paid=item.get("paid_book"), )._validate() now_page += 1