- SixClient中引入异步请求方法try_get_url获取并验证备用主机地址 - 初始化__base_url时支持异步调用,提升启动时灵活性 - _do_post与相关异步请求方法改用异常抛出替代返回None规范错误处理 - 修正部分解码逻辑,确保签名等字段的正确Base64和URL解码 - 代码中添加日志和重试机制以提升异常处理和调试能力 - 删除june模块中遗留的单元测试代码 - 调整june模型中字段类型,支持可选字符串以增强健壮性 - apps/apple/clients/itunes中添加Field默认值,防止字段缺失错误 - itunes解析XML相关函数增强健壮性,避免空指针异常 - core.clients.http_client支持完整http路径调用,注释掉自动抛错逻辑以兼容特殊响应 - base.py中retry_backoff类型显式定义为float,提高代码类型安全性
61 lines
2.0 KiB
Python
61 lines
2.0 KiB
Python
from pydantic import BaseModel, Field, ConfigDict
|
|
|
|
|
|
class RedeemFailResponseModel(BaseModel):
|
|
model_config = ConfigDict(extra="ignore")
|
|
|
|
errorMessageKey: str = Field(default="", alias="errorMessageKey")
|
|
errorMessage: str = Field(default="", alias="errorMessage")
|
|
userPresentableErrorMessage: str = Field(
|
|
default="", alias="userPresentableErrorMessage"
|
|
)
|
|
origin_log: str = Field(default="")
|
|
origin_status_code: int = Field(default=0, alias="originStatusCode", description="原始状态码")
|
|
status: int = Field(..., alias="status", description="0.需要登录 1.正常")
|
|
|
|
|
|
class TotalCreditModel(BaseModel):
|
|
# movieRentalBalance: int
|
|
# songBalance: int
|
|
# videoBalance: int
|
|
money: str = Field(default="")
|
|
totalCredit: str = Field(default="")
|
|
moneyRaw: float = Field(default=0)
|
|
# gameBalance: int
|
|
# tvRentalBalance: int
|
|
|
|
|
|
class CustomSuccessData(BaseModel):
|
|
isAmplifyRedemption: bool
|
|
isUpsell: bool
|
|
|
|
|
|
class RedeemedCredit(BaseModel):
|
|
movieRentalBalance: int = Field(default=0)
|
|
songBalance: int = Field(default=0)
|
|
videoBalance: int = Field(default=0)
|
|
money: str = Field(default="")
|
|
totalCredit: str = Field(default="")
|
|
moneyRaw: float = Field(default=0)
|
|
gameBalance: int = Field(default=0)
|
|
tvRentalBalance: int = Field(default=0)
|
|
|
|
|
|
class RedeemSuccessResponse(BaseModel):
|
|
# woinst: int = Field(default=0)
|
|
creditDisplay: str = Field(default="")
|
|
totalCredit: TotalCreditModel = Field(default_factory=TotalCreditModel)
|
|
# giftCertificateBonusId: int
|
|
# dsPersonId: str
|
|
# redeemCount: int
|
|
# isOptedInForPersonalizedRecommendations: bool
|
|
# isSubscription: bool
|
|
# triggerDownload: bool
|
|
# customSuccessData: CustomSuccessData
|
|
redeemedCredit: RedeemedCredit = Field(default_factory=RedeemedCredit)
|
|
# wosid: str
|
|
# protocolVersion: str
|
|
email: str = Field(default="")
|
|
status: int = Field(default=0)
|
|
origin_log: str = Field(default="", alias="originLog")
|