|
|
@@ -10,14 +10,15 @@ import com.fs.live.domain.LiveUserFavorite;
|
|
|
import com.fs.live.domain.LiveUserFollow;
|
|
|
import com.fs.live.domain.LiveUserLike;
|
|
|
import com.fs.live.mapper.LiveDataMapper;
|
|
|
+import com.fs.live.mapper.LiveMsgMapper;
|
|
|
+import com.fs.live.mapper.LiveUserFirstEntryMapper;
|
|
|
+import com.fs.live.mapper.LiveWatchUserMapper;
|
|
|
import com.fs.live.service.ILiveDataService;
|
|
|
import com.fs.live.service.ILiveUserFavoriteService;
|
|
|
import com.fs.live.service.ILiveUserFollowService;
|
|
|
import com.fs.live.service.ILiveUserLikeService;
|
|
|
-import com.fs.live.vo.ColumnsConfigVo;
|
|
|
-import com.fs.live.vo.DateRange;
|
|
|
-import com.fs.live.vo.RecentLiveDataVo;
|
|
|
-import com.fs.live.vo.TrendDataVO;
|
|
|
+import com.fs.live.vo.*;
|
|
|
+import io.swagger.models.auth.In;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -62,6 +63,40 @@ public class LiveDataServiceImpl implements ILiveDataService {
|
|
|
private ILiveUserFavoriteService liveUserFavoriteService;
|
|
|
@Autowired
|
|
|
private LiveDataMapper baseMapper;
|
|
|
+ @Autowired
|
|
|
+ private LiveUserFirstEntryMapper liveUserFirstEntryMapper;
|
|
|
+ @Autowired
|
|
|
+ private LiveWatchUserMapper liveWatchUserMapper;
|
|
|
+ @Autowired
|
|
|
+ private LiveMsgMapper liveMsgMapper;
|
|
|
+
|
|
|
+
|
|
|
+ /* 直播大屏展示 数据接口 */
|
|
|
+ @Override
|
|
|
+ public R dashboardData(Long liveId) {
|
|
|
+ Map<String,BigDecimal> map1 = liveWatchUserMapper.selectDashboardCount(liveId);
|
|
|
+ Map<String,Integer> map2 = baseMapper.selectDashboardCount(liveId);
|
|
|
+ Map<String, Long> map3 = liveMsgMapper.selectDashboardCount(liveId);
|
|
|
+ Map<String,BigDecimal> map4 = liveUserFirstEntryMapper.selectDashboardCount(liveId);
|
|
|
+ LiveDashBoardDataVo result = new LiveDashBoardDataVo();
|
|
|
+ result.setOnlineNum(map1.getOrDefault("onlineNum", BigDecimal.valueOf(0)));
|
|
|
+ result.setOldUserNum(map1.getOrDefault("oldUserNum", BigDecimal.valueOf(0)));
|
|
|
+ result.setNewUserNum(map1.getOrDefault("newUserNum", BigDecimal.valueOf(0)));
|
|
|
+ result.setViewNum(map2.getOrDefault("viewNum", 0));
|
|
|
+ result.setLikeNum(map2.getOrDefault("likeNum", 0));
|
|
|
+ result.setCommentNum(map3.getOrDefault("commentNum", 0L));
|
|
|
+ result.setShareUrlNum(map4.getOrDefault("shareUrlNum", BigDecimal.valueOf(0)));
|
|
|
+ result.setDirectAccessNum(map4.getOrDefault("directAccessNum", BigDecimal.valueOf(0)));
|
|
|
+ List<LiveUserFirstVo> liveUserFirstVos = liveUserFirstEntryMapper.selectDashboardInviteCount(liveId);
|
|
|
+ result.setInviteUserList(liveUserFirstVos);
|
|
|
+ return R.ok().put("data", result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<LiveUserFirstVo> inviteList(Long liveId) {
|
|
|
+ return liveUserFirstEntryMapper.inviteList(liveId);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询直播数据
|
|
|
*
|