课程AI设置优化

This commit is contained in:
huangrun
2025-12-08 17:55:29 +08:00
parent d0c5d2d561
commit a0e1fea805
3 changed files with 26 additions and 22 deletions

View File

@@ -490,25 +490,27 @@ public class CourseAuditApi extends ApiBaseController{
.aiSet(course.getAiSet())
.languageStatus(course.getLanguageStatus())
.build() ;
for (CourseContent cc : cclist) {
//筛选视频资源
if(cc.getContentType() == 10 ){
JSONObject json = JSONObject.parseObject(cc.getContent());
if(json == null || json.getString("url") == null) {
continue;
if(cclist != null && !cclist.isEmpty()){
for (CourseContent cc : cclist) {
//筛选视频资源
if(cc.getContentType() == 10 ){
JSONObject json = JSONObject.parseObject(cc.getContent());
if(json == null || json.getString("url") == null) {
continue;
}
String videoUrl = json.getString("url");
//String videoUrlPerfix = "https://u-pre.boe.com/upload"; //测试
//String videoUrlPerfix = "https://u.boe.com/upload"; //生产
String videoType = videoUrl.substring(videoUrl.lastIndexOf(".")+1);
videoList.add(BoeaiVideoResourceDto.builder()
.courseId(cc.getCourseId())
.videoId(cc.getId())
.title(cc.getContentName())
.originalUrl(videoUrlPerfix+videoUrl)
.duration(cc.getDuration())
.format(videoType)
.build());
}
String videoUrl = json.getString("url");
//String videoUrlPerfix = "https://u-pre.boe.com/upload"; //测试
//String videoUrlPerfix = "https://u.boe.com/upload"; //生产
String videoType = videoUrl.substring(videoUrl.lastIndexOf(".")+1);
videoList.add(BoeaiVideoResourceDto.builder()
.courseId(cc.getCourseId())
.videoId(cc.getId())
.title(cc.getContentName())
.originalUrl(videoUrlPerfix+videoUrl)
.duration(cc.getDuration())
.format(videoType)
.build());
}
}
boeaiCourseDto.setBoeaiVideoResourceReqList(videoList);

View File

@@ -462,7 +462,7 @@ public class CourseServiceImpl implements ICourseService {
rs.setCount(listByFilters2.size());
rs.setPageSize(pageSize);
rs.setList(paginate);
if (!paginate.isEmpty()) {
if (paginate != null && !paginate.isEmpty()) {
log.info("-----KJB------ getCourse");
for (Course course : paginate) {
this.getCourseFromKJB(course);

View File

@@ -217,9 +217,11 @@ public class StudyCourseApi extends ApiBaseController{
List<CourseSection> sectionlist=sectionService.getByCourseId(cid);
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(cid);
for (CourseContent cc : cclist) {
log.info("根据视频信息查询AI字幕数据cc = " + cc.toString());
this.getVtt( cid , cc);
if(cclist!=null && !cclist.isEmpty()){
for (CourseContent cc : cclist) {
log.info("根据视频信息查询AI字幕数据cc = " + cc.toString());
this.getVtt( cid , cc);
}
}
//获取教师的介绍信息,因为一门课程 的教师不会太多,所以这里简单直接遍历查询,后续再优化