虎牙开放平台文档

hyExt.revenue.checkStreamerGoodsExpire

  • 判断当前主播指定的商品的使用有效期
  • 引入版本 1.10.0
  • 适用终端
    • 虎牙直播助手-iOS:未实现
    • 虎牙直播助手-安卓:未实现
    • 虎牙直播PC客户端-主播侧:4.16.1.0

接口签名

declare namespace hyExt { module revenue { /** * 判断当前主播指定的商品的使用有效期 * @param params 输入参数 */ function checkStreamerGoodsExpire( params: GoodsExpireReq ): Promise<GoodsExpireRsp> } /** * 指定商品的使用有效期参数 */ type GoodsExpireReq = { /** * 商品id */ goodsUuid: string } /** * 指定商品的使用有效期信息 */ type GoodsExpireRsp = { /** * 主播指定商品的失效日期时间戳,没有购买过则返回-1 */ expire: number /** * 是否有购买过 */ hadBuy: boolean } }

示例代码

hyExt.revenue .checkStreamerGoodsExpire({ goodsUuid: "goodsUuid", }) .then((res) => { const { expire, hadBuy } = res console.log("调用hyExt.revenue.checkStreamerGoodsExpire成功", res) }) .catch((err) => { console.log("调用hyExt.revenue.checkStreamerGoodsExpire失败", err) })