修改直播间返回参数

This commit is contained in:
xuwenbo
2020-08-31 11:11:25 +08:00
parent 610cce7aa7
commit 4a5b00e8aa
6 changed files with 30 additions and 13 deletions

View File

@ -12,6 +12,7 @@ import co.yixiang.common.service.BaseService;
import co.yixiang.modules.wechat.domain.YxWechatLive;
import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
import co.yixiang.modules.wechat.vo.WechatLiveVo;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
@ -40,7 +41,7 @@ public interface YxWechatLiveService extends BaseService<YxWechatLive>{
* @param pageable 分页参数
* @return Map<String,Object>
*/
Map<String,Object> queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable);
WechatLiveVo queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable);
/**
* 查询所有数据不分页

View File

@ -25,6 +25,7 @@ import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
import co.yixiang.modules.wechat.service.dto.YxWechatLiveGoodsDto;
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
import co.yixiang.modules.wechat.service.mapper.YxWechatLiveMapper;
import co.yixiang.modules.wechat.vo.WechatLiveVo;
import co.yixiang.tools.config.WxMaConfiguration;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
@ -88,10 +89,10 @@ public class YxWechatLiveServiceImpl extends BaseServiceImpl<YxWechatLiveMapper,
}
@Override
//@Cacheable
public Map<String, Object> queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable) {
public WechatLiveVo queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable) {
getPage(pageable);
PageInfo<YxWechatLive> page = new PageInfo<>(queryAll(criteria));
Map<String, Object> map = new LinkedHashMap<>(2);
WechatLiveVo wechatLiveVo = new WechatLiveVo();
// List<WxMaLiveResult.RoomInfo> liveInfos = wxMaLiveService.getLiveInfos();
List<YxWechatLiveDto> liveDtos = generator.convert(page.getList(), YxWechatLiveDto.class);
//获取所有商品
@ -104,9 +105,9 @@ public class YxWechatLiveServiceImpl extends BaseServiceImpl<YxWechatLiveMapper,
}
i.setId(i.getRoomid());
});
map.put("content",liveDtos);
map.put("totalElements", page.getTotal());
return map;
wechatLiveVo.setContent(liveDtos);
wechatLiveVo.setTotalElements(page.getTotal());
return wechatLiveVo;
}
@Override
public boolean saveLive(YxWechatLive resources){

View File

@ -0,0 +1,14 @@
package co.yixiang.modules.wechat.vo;
import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
import lombok.Data;
import java.util.List;
@Data
public class WechatLiveVo {
private List<YxWechatLiveDto> content;
private Long totalElements;
}