"""看激励视频发奖相关 schemas。 约定同其余模块:字段 snake_case、金额/次数存整数。 """ from __future__ import annotations from pydantic import BaseModel, Field class PangleCallbackOut(BaseModel): """回给穿山甲 GroMore 的回调响应。 GroMore 服务端激励回调规范(supportcenter/26240)要求响应体为 `{"is_verify": bool, "reason": int}`: - `is_verify=true` + `reason=0`:校验通过、发放奖励(发奖成功 或 当日已达上限均算"已处理")。 - `is_verify=false`:不发放,`reason` 带错误码透传客户端 SDK(见 ad.py 的 REASON_*)。 验签失败由 API 层直接返 403,不走这里。""" is_verify: bool = True reason: int = 0 class AdRewardStatusOut(BaseModel): """客户端查今日看广告发奖进度(福利页"看视频赚金币"用)。""" used_today: int = Field(..., description="今日已成功发奖次数") daily_limit: int = Field(..., description="每日发奖次数上限") remaining: int = Field(..., description="今日剩余可领次数") coin_per_ad: int = Field(..., description="看完一个激励视频发的金币") class TestGrantOut(BaseModel): """[仅本地联调]模拟发奖结果。带上今日进度,客户端可直接据此刷新展示。""" granted: bool = Field(..., description="本次是否真的发了金币(达每日上限则 False)") status: str = Field(..., description="granted / capped") coin: int = Field(..., description="本次发放金币(capped 时为 0)") used_today: int = Field(..., description="今日已成功发奖次数") daily_limit: int = Field(..., description="每日发奖次数上限") remaining: int = Field(..., description="今日剩余可领次数") coin_per_ad: int = Field(..., description="看完一个激励视频发的金币")