|
@@ -2,6 +2,7 @@ package com.miaxis.teachingVideo.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.miaxis.common.core.domain.Response;
|
|
import com.miaxis.common.core.domain.Response;
|
|
@@ -11,9 +12,13 @@ import com.miaxis.common.utils.bean.BeanUtils;
|
|
import com.miaxis.file.domain.FileInfo;
|
|
import com.miaxis.file.domain.FileInfo;
|
|
import com.miaxis.file.service.IFileInfoService;
|
|
import com.miaxis.file.service.IFileInfoService;
|
|
import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
|
|
import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
|
|
|
|
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
|
|
import com.miaxis.teachingVideo.dto.TeachingVideoInfoDto;
|
|
import com.miaxis.teachingVideo.dto.TeachingVideoInfoDto;
|
|
import com.miaxis.teachingVideo.mapper.TeachingVideoInfoMapper;
|
|
import com.miaxis.teachingVideo.mapper.TeachingVideoInfoMapper;
|
|
import com.miaxis.teachingVideo.service.ITeachingVideoInfoService;
|
|
import com.miaxis.teachingVideo.service.ITeachingVideoInfoService;
|
|
|
|
+import com.miaxis.teachingVideo.service.ITeachingVideoTypeInfoService;
|
|
|
|
+import com.miaxis.teachingVideo.vo.AppletTeachingVideoVo;
|
|
|
|
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoAppletVo;
|
|
import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
|
|
import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
|
|
import com.tencentcloudapi.vod.v20180717.VodClient;
|
|
import com.tencentcloudapi.vod.v20180717.VodClient;
|
|
import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosRequest;
|
|
import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosRequest;
|
|
@@ -23,7 +28,10 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 教学视频Service业务层处理
|
|
* 教学视频Service业务层处理
|
|
@@ -41,6 +49,8 @@ public class TeachingVideoInfoServiceImpl extends ServiceImpl<TeachingVideoInfoM
|
|
|
|
|
|
private final VodClient vodClient;
|
|
private final VodClient vodClient;
|
|
|
|
|
|
|
|
+ private final ITeachingVideoTypeInfoService videoTypeInfoService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询教学视频列表
|
|
* 查询教学视频列表
|
|
*
|
|
*
|
|
@@ -278,4 +288,33 @@ public class TeachingVideoInfoServiceImpl extends ServiceImpl<TeachingVideoInfoM
|
|
return Response.success();
|
|
return Response.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * applet
|
|
|
|
+ * 查询教学视频列表
|
|
|
|
+ * @param pid
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Response queryTeachingVideoInfoList(String pid) {
|
|
|
|
+
|
|
|
|
+ ArrayList<AppletTeachingVideoVo> appletVideoVos = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ //获取pid下的二级分类id
|
|
|
|
+ List<TeachingVideoTypeInfo> typeInfos = videoTypeInfoService.list(new QueryWrapper<TeachingVideoTypeInfo>().eq("pid", pid).eq("status", 0).orderByAsc("type_sort"));
|
|
|
|
+ List<TeachingVideoInfoAppletVo> appletVos = teachingVideoInfoMapper.getTeachingVideoDetailsByTypeIds(pid);
|
|
|
|
+
|
|
|
|
+ for (TeachingVideoTypeInfo typeInfo : typeInfos) {
|
|
|
|
+ AppletTeachingVideoVo videoVo = new AppletTeachingVideoVo();
|
|
|
|
+ videoVo.setTypeName(typeInfo.getTypeName());
|
|
|
|
+ videoVo.setList(appletVos
|
|
|
|
+ .parallelStream()
|
|
|
|
+ .filter(f -> f.getTeachingVideoTypeId().toString().equals(typeInfo.getId().toString()))
|
|
|
|
+ .collect(Collectors.toList()));
|
|
|
|
+ appletVideoVos.add(videoVo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return Response.success(appletVideoVos);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|