修改直播间返回参数
This commit is contained in:
@ -6,9 +6,9 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
url: jdbc:log4jdbc:mysql://localhost:3306/yshop3?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull
|
url: jdbc:log4jdbc:mysql://localhost:3306/yshopb2c?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||||
username: yshop3
|
username: root
|
||||||
password:
|
password: xxcs@!2019
|
||||||
|
|
||||||
# 初始化配置
|
# 初始化配置
|
||||||
initial-size: 3
|
initial-size: 3
|
||||||
|
@ -15,6 +15,7 @@ import co.yixiang.modules.wechat.domain.YxWechatLive;
|
|||||||
import co.yixiang.modules.wechat.service.YxWechatLiveService;
|
import co.yixiang.modules.wechat.service.YxWechatLiveService;
|
||||||
import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
|
import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
|
||||||
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
|
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
|
||||||
|
import co.yixiang.modules.wechat.vo.WechatLiveVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@ -44,7 +45,7 @@ public class WechatLiveController {
|
|||||||
|
|
||||||
@GetMapping("yxWechatLive")
|
@GetMapping("yxWechatLive")
|
||||||
@ApiOperation("查询所有直播间")
|
@ApiOperation("查询所有直播间")
|
||||||
public ApiResult<Map<String,Object>> getYxWechatLives(YxWechatLiveQueryCriteria criteria, Pageable pageable){
|
public ApiResult<WechatLiveVo> getYxWechatLives(YxWechatLiveQueryCriteria criteria, Pageable pageable){
|
||||||
return ApiResult.ok(yxWechatLiveService.queryAll(criteria,pageable));
|
return ApiResult.ok(yxWechatLiveService.queryAll(criteria,pageable));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://localhost:3306/yshop3?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://localhost:3306/yshopb2c?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: yshop3
|
username: root
|
||||||
password:
|
password: xxcs@!2019
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
@ -12,6 +12,7 @@ import co.yixiang.common.service.BaseService;
|
|||||||
import co.yixiang.modules.wechat.domain.YxWechatLive;
|
import co.yixiang.modules.wechat.domain.YxWechatLive;
|
||||||
import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
|
import co.yixiang.modules.wechat.service.dto.YxWechatLiveDto;
|
||||||
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
|
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
|
||||||
|
import co.yixiang.modules.wechat.vo.WechatLiveVo;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -40,7 +41,7 @@ public interface YxWechatLiveService extends BaseService<YxWechatLive>{
|
|||||||
* @param pageable 分页参数
|
* @param pageable 分页参数
|
||||||
* @return Map<String,Object>
|
* @return Map<String,Object>
|
||||||
*/
|
*/
|
||||||
Map<String,Object> queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable);
|
WechatLiveVo queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有数据不分页
|
* 查询所有数据不分页
|
||||||
|
@ -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.YxWechatLiveGoodsDto;
|
||||||
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
|
import co.yixiang.modules.wechat.service.dto.YxWechatLiveQueryCriteria;
|
||||||
import co.yixiang.modules.wechat.service.mapper.YxWechatLiveMapper;
|
import co.yixiang.modules.wechat.service.mapper.YxWechatLiveMapper;
|
||||||
|
import co.yixiang.modules.wechat.vo.WechatLiveVo;
|
||||||
import co.yixiang.tools.config.WxMaConfiguration;
|
import co.yixiang.tools.config.WxMaConfiguration;
|
||||||
import co.yixiang.utils.FileUtil;
|
import co.yixiang.utils.FileUtil;
|
||||||
import co.yixiang.utils.OrderUtil;
|
import co.yixiang.utils.OrderUtil;
|
||||||
@ -88,10 +89,10 @@ public class YxWechatLiveServiceImpl extends BaseServiceImpl<YxWechatLiveMapper,
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
//@Cacheable
|
//@Cacheable
|
||||||
public Map<String, Object> queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable) {
|
public WechatLiveVo queryAll(YxWechatLiveQueryCriteria criteria, Pageable pageable) {
|
||||||
getPage(pageable);
|
getPage(pageable);
|
||||||
PageInfo<YxWechatLive> page = new PageInfo<>(queryAll(criteria));
|
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<WxMaLiveResult.RoomInfo> liveInfos = wxMaLiveService.getLiveInfos();
|
||||||
List<YxWechatLiveDto> liveDtos = generator.convert(page.getList(), YxWechatLiveDto.class);
|
List<YxWechatLiveDto> liveDtos = generator.convert(page.getList(), YxWechatLiveDto.class);
|
||||||
//获取所有商品
|
//获取所有商品
|
||||||
@ -104,9 +105,9 @@ public class YxWechatLiveServiceImpl extends BaseServiceImpl<YxWechatLiveMapper,
|
|||||||
}
|
}
|
||||||
i.setId(i.getRoomid());
|
i.setId(i.getRoomid());
|
||||||
});
|
});
|
||||||
map.put("content",liveDtos);
|
wechatLiveVo.setContent(liveDtos);
|
||||||
map.put("totalElements", page.getTotal());
|
wechatLiveVo.setTotalElements(page.getTotal());
|
||||||
return map;
|
return wechatLiveVo;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean saveLive(YxWechatLive resources){
|
public boolean saveLive(YxWechatLive resources){
|
||||||
|
@ -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;
|
||||||
|
}
|
Reference in New Issue
Block a user