【积分商店】onmyoji_gacha 新增积分商店与兑换抽卡命令
This commit is contained in:
@@ -141,6 +141,20 @@ class DataManager:
|
||||
|
||||
return await self.get_draws_left(user_id) > 0
|
||||
|
||||
async def get_shop_products(self, user_id: str) -> Optional[Dict[str, Any]]:
|
||||
"""获取积分商店商品目录与该用户的个人上下文。"""
|
||||
|
||||
return await self._request("GET", "shop/products", params={"user_id": user_id})
|
||||
|
||||
async def exchange_shop_product(self, user_id: str, product_id: str) -> Optional[Dict[str, Any]]:
|
||||
"""兑换积分商店商品;返回含 success/message 的业务结果。"""
|
||||
|
||||
return await self._request(
|
||||
"POST",
|
||||
"shop/exchange",
|
||||
payload={"user_id": user_id, "product_id": product_id},
|
||||
)
|
||||
|
||||
async def record_draw_result(self, user_id: str, rarity: str, shikigami: Dict[str, Any]) -> Dict[str, Any]:
|
||||
"""写入一次抽卡并返回 xapi 原始业务结果。"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user