From 2e4b04d1d15948e2589bfc86ba18cf4f094595f6 Mon Sep 17 00:00:00 2001 From: huangrun Date: Wed, 19 Nov 2025 19:33:21 +0800 Subject: [PATCH] =?UTF-8?q?AI=E5=AD=97=E5=B9=95=E6=95=B0=E6=8D=AE=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xboe/school/study/api/StudyCourseApi.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java index c665ab1f..5e5da80f 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/api/StudyCourseApi.java @@ -210,9 +210,7 @@ public class StudyCourseApi extends ApiBaseController{ List cclist=contentService.getByCourseId(cid); List sectionlist=sectionService.getByCourseId(cid); List teachers=courseService.findTeachersByCourseId(cid); - if(cclist == null || cclist.size() == 0){ - log.info("========查询到视频数据========="); - } + for (CourseContent cc : cclist) { log.info("根据视频信息查询AI字幕数据:cc = " + cc.toString()); this.getVtt( cid , cc); @@ -345,18 +343,19 @@ public class StudyCourseApi extends ApiBaseController{ } //将返回string 转为json对象 JSONObject jsonObject = JSONObject.parseObject(result); - JSONArray rows = jsonObject.getJSONArray("rows"); + JSONArray rows = jsonObject.getJSONArray("data"); //将json数组转为list对象 List boeaiSubtitleRspList = new ArrayList<>(); //循环json对象 - for (int i = 0; i < rows.size(); i++) { - JSONObject row = rows.getJSONObject(i); - //将json对象转为实体对象 CourseContentVtt - BoeaiSubtitleRsp vtt = row.toJavaObject(BoeaiSubtitleRsp.class); - boeaiSubtitleRspList.add(vtt); + if(rows != null && !rows.isEmpty()){ + for (int i = 0; i < rows.size(); i++) { + JSONObject row = rows.getJSONObject(i); + //将json对象转为实体对象 CourseContentVtt + BoeaiSubtitleRsp vtt = row.toJavaObject(BoeaiSubtitleRsp.class); + boeaiSubtitleRspList.add(vtt); + } } - } /**