|
@@ -5,34 +5,29 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.fs.app.annotation.Login;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.domain.ResponseResult;
|
|
|
-import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
-import com.fs.course.domain.FsCourseQuestionBank;
|
|
|
import com.fs.course.domain.FsCourseWatchLog;
|
|
|
-import com.fs.course.param.FsUserCourseVideoAddKfUParam;
|
|
|
import com.fs.course.param.FsUserCourseVideoFinishUParam;
|
|
|
+import com.fs.course.param.newfs.FsUserCourseAddCompanyUserParam;
|
|
|
+import com.fs.course.param.newfs.FsUserCourseVideoLinkParam;
|
|
|
import com.fs.course.service.*;
|
|
|
-import com.fs.course.vo.FsUserCourseVideoH5DVO;
|
|
|
-import com.fs.course.vo.FsUserCourseVideoH5VO;
|
|
|
-import com.fs.course.vo.FsUserCourseVideoQuestionVO;
|
|
|
+import com.fs.course.vo.newfs.FsUserCourseVideoDetailsVO;
|
|
|
+import com.fs.course.vo.newfs.FsUserCourseVideoLinkDetailsVO;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
+import javax.validation.Valid;
|
|
|
|
|
|
-@Api("个微-h5看课接口")
|
|
|
+@Api("会员-h5看课接口")
|
|
|
@RestController
|
|
|
-@RequestMapping(value="/app/course/wx/h5")
|
|
|
-public class CourseWxH5Controller extends AppBaseController{
|
|
|
- Logger logger= LoggerFactory.getLogger(getClass());
|
|
|
+@RequestMapping(value = "/app/course/wx/h5")
|
|
|
+public class CourseWxH5Controller extends AppBaseController {
|
|
|
+ Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
@Autowired
|
|
|
private IFsUserCourseService courseService;
|
|
|
|
|
@@ -54,14 +49,14 @@ public class CourseWxH5Controller extends AppBaseController{
|
|
|
|
|
|
@Login
|
|
|
@ApiOperation("判断是否添加客服(是否关联销售)")
|
|
|
- @PostMapping("/isAddCompanyUser")
|
|
|
- public ResponseResult<Boolean> isAddCompanyUser(@RequestBody FsUserCourseVideoAddKfUParam param) {
|
|
|
+ @PostMapping("/isAddKf")
|
|
|
+ public ResponseResult<Boolean> isAddCompanyUser(@Valid @RequestBody FsUserCourseAddCompanyUserParam param) {
|
|
|
Long userId = Long.parseLong(getUserId());
|
|
|
param.setUserId(userId);
|
|
|
return courseVideoService.isAddCompanyUser(param);
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation("h5课程简介")
|
|
|
+ // @ApiOperation("h5课程简介")
|
|
|
// @GetMapping("/getH5CourseByVideoId")
|
|
|
// public R getCourseByVideoId(@RequestParam("videoId") Long videoId,HttpServletRequest request)
|
|
|
// {
|
|
@@ -69,59 +64,20 @@ public class CourseWxH5Controller extends AppBaseController{
|
|
|
// return R.ok().put("data",course);
|
|
|
// }
|
|
|
//
|
|
|
-// @ApiOperation("h5课程详情")
|
|
|
-// @GetMapping("/getH5CourseVideoDetails")
|
|
|
-// public R getCourseVideoDetails(FsUserCourseVideoFinishUParam param)
|
|
|
+ @ApiOperation("H5课程详情")
|
|
|
+ @GetMapping("/videoDetails")
|
|
|
+ public ResponseResult<FsUserCourseVideoLinkDetailsVO> getCourseVideoDetails(FsUserCourseVideoLinkParam param) {
|
|
|
+ return courseVideoService.getLinkCourseVideoDetails(param);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// @ApiOperation("添加看课记录")
|
|
|
+// @PostMapping("/addWatchLogByLink")
|
|
|
+// public R addWatchLogByLink(@RequestBody FsUserCourseAddCompanyUserParam param)
|
|
|
// {
|
|
|
-// String json = configService.selectConfigByKey("course.config");
|
|
|
-// CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
-// FsUserCourseVideoH5DVO course = courseService.selectFsUserCourseVideoH5DVOByVideoId(param.getVideoId());
|
|
|
-//
|
|
|
-// List<FsUserCourseVideoQuestionVO> questionVOList = new ArrayList<>();
|
|
|
-// if (StringUtils.isNotEmpty(course.getQuestionBankId())){
|
|
|
-// String[] questionIds = course.getQuestionBankId().split(",");
|
|
|
-// for (String questionId : questionIds){
|
|
|
-// FsUserCourseVideoQuestionVO vo = new FsUserCourseVideoQuestionVO();
|
|
|
-// FsCourseQuestionBank questionBank = questionBankService.selectFsCourseQuestionBankById(Long.parseLong(questionId));
|
|
|
-// if (questionBank!=null&&questionBank.getStatus()!=0){
|
|
|
-// BeanUtils.copyProperties(questionBank,vo);
|
|
|
-// questionVOList.add(vo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// Long duration = 0L;
|
|
|
-// long tipsTime = 0L;
|
|
|
-// int isFinish = 0;
|
|
|
-// if (param.getLinkType()!=null&¶m.getLinkType()==1){
|
|
|
-// return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime).put("maxBufferLength",config.getMaxBufferLength());
|
|
|
-// }
|
|
|
-// // 从Redis中获取观看时长
|
|
|
-// String redisKey = "h5user:watch:duration:" + param.getQwUserId()+ ":" + param.getQwExternalId() + ":" + param.getVideoId();
|
|
|
-// String durationStr = redisCache.getCacheObject(redisKey);
|
|
|
-// FsCourseWatchLog log = courseWatchLogService.getWatchCourseVideoH5(param.getVideoId(),param.getQwUserId(),param.getQwExternalId());
|
|
|
-// //redis取不到查库
|
|
|
-// if (durationStr != null) {
|
|
|
-// duration = Long.parseLong(durationStr);
|
|
|
-// }else {
|
|
|
-// duration = log.getDuration();
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (course.getDuration()!=null){
|
|
|
-// tipsTime = course.getDuration()/2;
|
|
|
-// }
|
|
|
-// //判断是否完课
|
|
|
-// if (log.getLogType()==2){
|
|
|
-// isFinish=1;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //将视频时长也存到redis
|
|
|
-// String videoRedisKey = "h5user:video:duration:" + param.getVideoId();
|
|
|
-// Long videoDuration = redisCache.getCacheObject(videoRedisKey);
|
|
|
-// if (videoDuration==null){
|
|
|
-// redisCache.setCacheObject(videoRedisKey,course.getDuration());
|
|
|
-// }
|
|
|
//
|
|
|
-// return R.ok().put("course",course).put("questions",questionVOList).put("config",config).put("playDuration",duration).put("tipsTime",tipsTime).put("maxBufferLength",config.getMaxBufferLength()).put("isFinish",isFinish); }
|
|
|
+// return null;
|
|
|
+// }
|
|
|
//
|
|
|
//
|
|
|
//
|
|
@@ -133,12 +89,12 @@ public class CourseWxH5Controller extends AppBaseController{
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
-// @ApiOperation("更新看课时长")
|
|
|
-// @PostMapping("/updateWatchDuration")
|
|
|
-// public R updateWatchDuration(@RequestBody FsUserCourseVideoFinishUParam param)
|
|
|
-// {
|
|
|
-// return courseVideoService.updateWatchDuration(param);
|
|
|
-// }
|
|
|
+ @ApiOperation("更新看课时长")
|
|
|
+ @PostMapping("/updateWatchDuration")
|
|
|
+ public R updateWatchDuration(@RequestBody FsUserCourseVideoFinishUParam param)
|
|
|
+ {
|
|
|
+ return courseVideoService.updateWatchDuration(param);
|
|
|
+ }
|
|
|
//
|
|
|
//
|
|
|
// @ApiOperation("获取缓冲流量")
|