fix: 完善小程序 Live 接口

This commit is contained in:
邹景立 2024-08-18 22:32:01 +08:00
parent e750ac9cd2
commit d422e5dc17

View File

@ -168,4 +168,303 @@ class Live extends BasicWeChat
$url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/getapproved?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 删除直播间
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function delLive($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/deleteroom?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 编辑直播间
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function editLive($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/editroom?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 获取直播间推流地址
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function getPushUrl($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/getpushurl?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 获取直播间分享二维码
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function getShareCode($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/getsharedcode?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 添加管理直播间小助手
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function addAssistant($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/addassistant?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 修改管理直播间小助手
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function modifyAssistant($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/modifyassistant?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 删除管理直播间小助手
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function removeAssistant($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/removeassistant?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 查询管理直播间小助手
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function getAssistantList($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/getassistantlist?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 添加主播副号
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function addSubAnchor($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/addsubanchor?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 修改主播副号
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function modifySubAnchor($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/modifysubanchor?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 修删除主播副号
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function delSubAnchor($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/deletesubanchor?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 查询除主播副号
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function getSubAnchor($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/getsubanchor?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 开启/关闭直播间官方收录
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function updateFeedPublic($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/updatefeedpublic?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 开启/关闭回放功能
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function updateReplay($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/updatereplay?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 开启/关闭客服功能
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function updateKf($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/updatekf?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 开启/关闭直播间全局禁言
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function updateComment($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/room/updatecomment?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 上下架商品
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function goodsOnsale($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/onsale?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 删除直播间商品
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function goodsDeleteInRoom($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/deleteInRoom?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 推送商品
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function goodsPush($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/push?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 商品排序
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function goodsSort($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/sort?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 下载商品讲解视频
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function getVideo($data)
{
$url = "https://api.weixin.qq.com/wxaapi/broadcast/goods/getVideo?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 获取长期订阅用户
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function getFollowers($data)
{
$url = "https://api.weixin.qq.com/wxa/business/get_wxa_followers?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
/**
* 长期订阅群发接口
* @param array $data
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function pushMessage($data)
{
$url = "https://api.weixin.qq.com/wxa/business/push_message?access_token=ACCESS_TOKEN";
return $this->callPostApi($url, $data, true);
}
}