接入虎牙精英宝典最新商城前置流程
This commit is contained in:
@@ -639,6 +639,110 @@ class QueryUserOrderListRsp(TafStruct):
|
||||
}
|
||||
|
||||
|
||||
class ShopAppRequest(TafStruct):
|
||||
"""商城前置 RPC 的公共请求字段。"""
|
||||
|
||||
def __init__(self):
|
||||
self.userId = UserId()
|
||||
self.shopAppInfo = ShopAppInfo()
|
||||
|
||||
def read_from(self, ins: TafInputStream):
|
||||
self.userId = ins.read_struct(0, UserId) or self.userId
|
||||
self.shopAppInfo = ins.read_struct(1, ShopAppInfo) or self.shopAppInfo
|
||||
|
||||
|
||||
class ListPayChannelReq(ShopAppRequest):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.supplierId = 0
|
||||
self.bizType = 5
|
||||
self.gameCategoryId = 507
|
||||
self.spuId = ""
|
||||
self.skuId = 0
|
||||
|
||||
def write_to(self, os: TafOutputStream):
|
||||
os.write_struct(0, self.userId)
|
||||
os.write_struct(1, self.shopAppInfo)
|
||||
os.write_int64(2, self.supplierId)
|
||||
os.write_int32(3, self.bizType)
|
||||
os.write_int32(4, self.gameCategoryId)
|
||||
os.write_string(5, self.spuId)
|
||||
os.write_int64(6, self.skuId)
|
||||
|
||||
|
||||
class CheckHyProtocolReq(ShopAppRequest):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.protocolVersion = 1
|
||||
|
||||
def write_to(self, os: TafOutputStream):
|
||||
os.write_struct(0, self.userId)
|
||||
os.write_struct(1, self.shopAppInfo)
|
||||
os.write_int32(2, self.protocolVersion)
|
||||
|
||||
|
||||
class CheckUserBuyAuthReq(ShopAppRequest):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.spuId = ""
|
||||
self.skuId = 0
|
||||
self.checkType = 3
|
||||
self.payChannel = ""
|
||||
self.itemCount = 0
|
||||
|
||||
def write_to(self, os: TafOutputStream):
|
||||
os.write_struct(0, self.userId)
|
||||
os.write_struct(1, self.shopAppInfo)
|
||||
os.write_string(2, self.spuId)
|
||||
os.write_int64(3, self.skuId)
|
||||
os.write_int32(4, self.checkType)
|
||||
os.write_string(5, self.payChannel)
|
||||
os.write_int32(6, self.itemCount)
|
||||
|
||||
|
||||
class ListPayChannelRsp(TafStruct):
|
||||
"""shopMiddleUI.listPayChannelV5 响应。"""
|
||||
|
||||
def __init__(self):
|
||||
self.code = 0
|
||||
self.message = ""
|
||||
self.channels: list[str] = []
|
||||
|
||||
def read_from(self, ins: TafInputStream):
|
||||
self.channels = ins.read_list(0)
|
||||
self.code = ins.read_int32(1, default=self.code)
|
||||
self.message = ins.read_string(2, default=self.message)
|
||||
_skip_to_struct_end(ins)
|
||||
|
||||
def write_to(self, os: TafOutputStream):
|
||||
os.write_list(0, self.channels)
|
||||
os.write_int32(1, self.code)
|
||||
os.write_string(2, self.message)
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
return {"code": self.code, "message": self.message, "channels": self.channels}
|
||||
|
||||
|
||||
class ShopCodeRsp(TafStruct):
|
||||
"""checkHyProtocolV5/checkUserBuyAuth 的状态响应。"""
|
||||
|
||||
def __init__(self):
|
||||
self.code = 0
|
||||
self.message = ""
|
||||
|
||||
def read_from(self, ins: TafInputStream):
|
||||
self.code = ins.read_int32(0, default=self.code)
|
||||
self.message = ins.read_string(1, default=self.message)
|
||||
_skip_to_struct_end(ins)
|
||||
|
||||
def write_to(self, os: TafOutputStream):
|
||||
os.write_int32(0, self.code)
|
||||
os.write_string(1, self.message)
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
return {"code": self.code, "message": self.message}
|
||||
|
||||
|
||||
class OrderDetailOrder(TafStruct):
|
||||
"""orderDetailV5 中的订单摘要;保留支付轮询所需字段。"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user