AI字幕数据查询

This commit is contained in:
huangrun
2025-11-19 19:33:21 +08:00
parent bffb85848f
commit 2e4b04d1d1

View File

@@ -210,9 +210,7 @@ public class StudyCourseApi extends ApiBaseController{
List<CourseContent> cclist=contentService.getByCourseId(cid); List<CourseContent> cclist=contentService.getByCourseId(cid);
List<CourseSection> sectionlist=sectionService.getByCourseId(cid); List<CourseSection> sectionlist=sectionService.getByCourseId(cid);
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(cid); List<CourseTeacher> teachers=courseService.findTeachersByCourseId(cid);
if(cclist == null || cclist.size() == 0){
log.info("========查询到视频数据=========");
}
for (CourseContent cc : cclist) { for (CourseContent cc : cclist) {
log.info("根据视频信息查询AI字幕数据cc = " + cc.toString()); log.info("根据视频信息查询AI字幕数据cc = " + cc.toString());
this.getVtt( cid , cc); this.getVtt( cid , cc);
@@ -345,18 +343,19 @@ public class StudyCourseApi extends ApiBaseController{
} }
//将返回string 转为json对象 //将返回string 转为json对象
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
JSONArray rows = jsonObject.getJSONArray("rows"); JSONArray rows = jsonObject.getJSONArray("data");
//将json数组转为list对象 //将json数组转为list对象
List<BoeaiSubtitleRsp> boeaiSubtitleRspList = new ArrayList<>(); List<BoeaiSubtitleRsp> boeaiSubtitleRspList = new ArrayList<>();
//循环json对象 //循环json对象
for (int i = 0; i < rows.size(); i++) { if(rows != null && !rows.isEmpty()){
JSONObject row = rows.getJSONObject(i); for (int i = 0; i < rows.size(); i++) {
//将json对象转为实体对象 CourseContentVtt JSONObject row = rows.getJSONObject(i);
BoeaiSubtitleRsp vtt = row.toJavaObject(BoeaiSubtitleRsp.class); //将json对象转为实体对象 CourseContentVtt
boeaiSubtitleRspList.add(vtt); BoeaiSubtitleRsp vtt = row.toJavaObject(BoeaiSubtitleRsp.class);
boeaiSubtitleRspList.add(vtt);
}
} }
} }
/** /**