Merge branch 'master' of https://gitee.com/wjl2008_admin/nuttyreading-java into zcc
This commit is contained in:
@@ -74,6 +74,7 @@ public class ShiroConfig {
|
||||
filterMap.put("/book/user/**","anon");
|
||||
filterMap.put("/sys/vodAli/vodAliVideoRe","anon");
|
||||
filterMap.put("/sys/vodAli/getTokenForYLJK","anon");
|
||||
filterMap.put("/sys/vodAli/uploadCallback","anon");
|
||||
filterMap.put("/webjars/**", "anon");
|
||||
filterMap.put("/druid/**", "anon");
|
||||
filterMap.put("/app/**", "anon");
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.peanut.modules.master.controller;
|
||||
import com.aliyun.vod20170321.models.GenerateKMSDataKeyResponseBody;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.common.utils.SpdbUtil;
|
||||
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
||||
import com.peanut.modules.common.dao.VideoM3u8Dao;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.common.to.EditCourseRecordDto;
|
||||
@@ -35,6 +37,8 @@ public class CourseController {
|
||||
@Autowired
|
||||
private CourseCatalogueChapterVideoService courseCatalogueChapterVideoService;
|
||||
@Autowired
|
||||
private CourseCatalogueChapterVideoDao courseCatalogueChapterVideoDao;
|
||||
@Autowired
|
||||
private SysCourseDirectService sysCourseDirectService;
|
||||
@Autowired
|
||||
private ShopProductService shopProductService;
|
||||
@@ -93,6 +97,20 @@ public class CourseController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping("/cossVod1")
|
||||
public R cossVod1() throws Exception {
|
||||
MPJLambdaWrapper<CourseCatalogueChapterVideoEntity> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(CourseCatalogueChapterVideoEntity.class);
|
||||
wrapper.leftJoin(VideoM3u8Entity.class,VideoM3u8Entity::getVid,CourseCatalogueChapterVideoEntity::getVideo);
|
||||
wrapper.eq(CourseCatalogueChapterVideoEntity::getType,1);
|
||||
wrapper.isNull(VideoM3u8Entity::getId);
|
||||
List<CourseCatalogueChapterVideoEntity> courseCatalogueChapterVideoEntities = courseCatalogueChapterVideoDao.selectJoinList(CourseCatalogueChapterVideoEntity.class, wrapper);
|
||||
for (CourseCatalogueChapterVideoEntity c:courseCatalogueChapterVideoEntities){
|
||||
spdbUtil.vodTranslationM3u8(c.getVideo());
|
||||
}
|
||||
return R.ok().put("list",courseCatalogueChapterVideoEntities);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/getCoursedetail")
|
||||
|
||||
@@ -118,6 +118,13 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
||||
String url = urlBody==null?null:urlBody.getPlayInfoList().getPlayInfo().get(0).getPlayURL()+"?MtsHlsUriToken="+s;
|
||||
video.setMtsHlsUriToken(s);
|
||||
video.setM3u8Url(url);
|
||||
//添加转码失败的标记
|
||||
if(url==null){
|
||||
List<VideoM3u8Entity> videoM3u8Entities = videoM3u8Dao.selectList(new LambdaQueryWrapper<VideoM3u8Entity>().eq(VideoM3u8Entity::getVid, video.getVideo()));
|
||||
VideoM3u8Entity videoM3u8Entity = videoM3u8Entities.get(0);
|
||||
videoM3u8Entity.setState(1);
|
||||
videoM3u8Dao.updateById(videoM3u8Entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
UserCourseVideoPositionEntity videoPosition = getVideoPosition(video, uId);
|
||||
@@ -125,20 +132,20 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
||||
if (video.getType() == 0) {
|
||||
String s_str = "";
|
||||
if (video.getVideo().startsWith("common/")) {
|
||||
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/";
|
||||
s_str = "http://oss.taihumed.com/video/";
|
||||
} else if (video.getVideo().startsWith("article/")) {
|
||||
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/";
|
||||
s_str = "http://oss.taihumed.com/video/";
|
||||
} else {
|
||||
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/video/taiHuClass/";
|
||||
s_str = "http://oss.taihumed.com/video/taiHuClass/";
|
||||
}
|
||||
video.setVideoUrl(s_str + video.getVideo());
|
||||
}
|
||||
if(video.getType() == 2){
|
||||
String s_str = "";
|
||||
if (video.getVideo().startsWith("article/")) {
|
||||
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/voice/article/";
|
||||
s_str = "http://oss.taihumed.com/voice/article/";
|
||||
} else {
|
||||
s_str = "https://ehh-private-01.oss-cn-beijing.aliyuncs.com/voice/taiHuClass/";
|
||||
s_str = "http://oss.taihumed.com/voice/taiHuClass/";
|
||||
}
|
||||
video.setVideoUrl(s_str + video.getVideo());
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@@ -180,10 +181,15 @@ public class CourseController {
|
||||
}
|
||||
|
||||
@RequestMapping("/saveCoursePosition")
|
||||
public R saveCoursePosition(@RequestBody Map<String,Integer> map){
|
||||
public R saveCoursePosition(@RequestBody Map<String,Object> map){
|
||||
Integer uId = ShiroUtils.getUId();
|
||||
Integer videoId = map.get("videoId");
|
||||
Integer position = map.get("position");
|
||||
|
||||
Integer videoId = Integer.valueOf(map.get("videoId").toString());
|
||||
String po = map.get("position").toString();
|
||||
if(Objects.equals(po, "none")){
|
||||
return R.ok();
|
||||
}
|
||||
int position = Integer.valueOf(po);
|
||||
courseCatalogueChapterVideoService.saveCoursePosition(uId,videoId,position);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
redis:
|
||||
open: false # 是否开启redis缓存 true开启 false关闭
|
||||
database: 0
|
||||
host: 47.93.127.115
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: Jgll2015 # 密码(默认为空)
|
||||
timeout: 6000000ms # 连接超时时长(毫秒)
|
||||
@@ -91,5 +91,5 @@ wxpay:
|
||||
privateKeyUrl: F:\hs\nuttyreading-java\src\main\resources\cent\apiclient_key.pem
|
||||
|
||||
|
||||
redisAddress: redis://47.93.127.115:6379
|
||||
redisAddress: redis://127.0.0.1:6379
|
||||
redisPassword: Jgll2015
|
||||
Reference in New Issue
Block a user