mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🎨 #2785【小程序】获取直播间分享二维码接口优化,支持分享路径和海报
This commit is contained in:
@@ -84,7 +84,7 @@ public interface WxMaLiveService {
|
||||
* @return .
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
String getSharedCode(Integer roomId, String params) throws WxErrorException;
|
||||
WxMaLiveSharedCode getSharedCode(Integer roomId, String params) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取直播房间列表.(分页)
|
||||
|
||||
@@ -87,7 +87,7 @@ public class WxMaLiveServiceImpl implements WxMaLiveService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSharedCode(Integer roomId, String params) throws WxErrorException {
|
||||
public WxMaLiveSharedCode getSharedCode(Integer roomId, String params) throws WxErrorException {
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put(ROOM_ID, roomId);
|
||||
if (null != params) {
|
||||
@@ -98,7 +98,7 @@ public class WxMaLiveServiceImpl implements WxMaLiveService {
|
||||
if (jsonObject.get(ERR_CODE).getAsInt() != 0) {
|
||||
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
|
||||
}
|
||||
return jsonObject.get("cdnUrl").getAsString();
|
||||
return WxMaGsonBuilder.create().fromJson(responseContent, WxMaLiveSharedCode.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.binarywang.wx.miniapp.bean.live;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class WxMaLiveSharedCode implements Serializable {
|
||||
private static final long serialVersionUID = 8525117884393611947L;
|
||||
/**
|
||||
* 分享二维码
|
||||
*/
|
||||
@SerializedName("cdnUrl")
|
||||
private String cdnUrl;
|
||||
/**
|
||||
* 分享路径
|
||||
*/
|
||||
@SerializedName("pagePath")
|
||||
private String pagePath;
|
||||
/**
|
||||
* 分享海报
|
||||
*/
|
||||
@SerializedName("posterUrl")
|
||||
private String posterUrl;
|
||||
}
|
||||
Reference in New Issue
Block a user