添加直播回放接口

This commit is contained in:
xuwenbo
2020-09-01 15:18:06 +08:00
parent 6fa3077d83
commit 302415542a
4 changed files with 28 additions and 2 deletions

View File

@ -8,6 +8,7 @@
*/
package co.yixiang.modules.wechat.service;
import cn.binarywang.wx.miniapp.bean.WxMaLiveResult;
import co.yixiang.common.service.BaseService;
import co.yixiang.modules.wechat.domain.YxWechatLive;
import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
@ -60,4 +61,11 @@ public interface YxWechatLiveService extends BaseService<YxWechatLive>{
* @throws IOException /
*/
void download(List<YxWechatLiveDto> all, HttpServletResponse response) throws IOException;
/**
* 获取直播回放
* @param roomId
* @return
*/
List<WxMaLiveResult.LiveReplay> getLiveReplay(Integer roomId);
}

View File

@ -144,7 +144,18 @@ public class YxWechatLiveServiceImpl extends BaseServiceImpl<YxWechatLiveMapper,
return baseMapper.selectList(QueryHelpPlus.getPredicate(YxWechatLive.class, criteria));
}
@Override
//@Cacheable
public List<WxMaLiveResult.LiveReplay> getLiveReplay(Integer roomId){
WxMaService wxMaService = WxMaConfiguration.getWxMaService();
WxMaLiveResult get_replay = new WxMaLiveResult();
try {
get_replay = wxMaService.getLiveService().getLiveReplay("get_replay", roomId, 0, 100);
} catch (WxErrorException e) {
e.printStackTrace();
}
return get_replay.getLiveReplay();
}
@Override
public void download(List<YxWechatLiveDto> all, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();