kjb接口添加配置

This commit is contained in:
huangrun
2025-11-21 14:27:21 +08:00
parent b0a0725373
commit 80b444c188
5 changed files with 23 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -67,6 +68,9 @@ public class CourseAuditApi extends ApiBaseController{
@Resource
private ThirdApi thirdApi;
@Value("${kjb.aicoreUrl}")
private String aicoreUrl;
/**
* 教师需要审核的课程
@@ -509,7 +513,7 @@ public class CourseAuditApi extends ApiBaseController{
paramReq.setBoeaiCourseReqList(courseDtos);
ObjectMapper objectMapper = new ObjectMapper();
String message = objectMapper.writeValueAsString(paramReq);
String url = "http://10.251.186.27:8088/aiVideo/saveCourse";
String url = aicoreUrl +"/aiVideo/saveCourse";
HttpUtils.sendMessage(message,url);
}

View File

@@ -23,6 +23,7 @@ import com.xboe.school.study.service.IStudyCourseService;
import com.xboe.system.organization.service.IOrganizationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -81,6 +82,9 @@ public class CourseFullTextApi extends ApiBaseController{
@Autowired
StringRedisTemplate redisTemplate;
@Value("${kjb.aicoreUrl}")
private String aicoreUrl;
/**
* 课程的初始化
* @return
@@ -424,7 +428,7 @@ public class CourseFullTextApi extends ApiBaseController{
String courseId = courseFull.getId();
log.info("------------KJB---获取课程摘要信息---------courseId = " + courseId);
//String url = env.getProperty("kjb.url") + "/api/course/getCourseFromKJB?courseId=" + courseId;
String url = "http://10.251.186.27:8088/aiVideo/getCourseList";
String url = aicoreUrl + "/aiVideo/getCourseList";
JSONObject jsonObject = new JSONObject();
JSONArray courseIds = new JSONArray();

View File

@@ -37,6 +37,7 @@ import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.hibernate.mapping.IdGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@@ -122,6 +123,9 @@ public class CourseServiceImpl implements ICourseService {
@Resource
private ModifyLogDao modifyLogDao;
@Value("${kjb.aicoreUrl}")
private String aicoreUrl;
/**
* 生成过滤条件
*
@@ -471,7 +475,7 @@ public class CourseServiceImpl implements ICourseService {
String courseId = course.getId();
log.info("------------KJB---获取课程信息---------: courseId = " + courseId);
//String url = env.getProperty("kjb.url") + "/api/course/getCourseFromKJB?courseId=" + courseId;
String url = "http://10.251.186.27:8088/aiVideo/getCourseList";
String url = aicoreUrl + "/aiVideo/getCourseList";
JSONObject jsonObject = new JSONObject();
JSONArray courseIds = new JSONArray();

View File

@@ -27,6 +27,7 @@ import com.xboe.school.vo.StudyTimeVo;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -109,6 +110,9 @@ public class StudyCourseApi extends ApiBaseController{
@Autowired
StringRedisTemplate redisTemplate;
@Value("${kjb.aicoreUrl}")
private String aicoreUrl;
/**
* 用于查询课程的学习记录
* @param pager
@@ -334,7 +338,7 @@ public class StudyCourseApi extends ApiBaseController{
public void getVtt(String couirseId, CourseContent cc){
log.info("------KJB --------- getVtt couirseId = " + couirseId + " videoId = " + cc.getId());
String url = "http://10.251.186.27:8088/aiVideo/getVideoVtt";
String url = aicoreUrl + "/aiVideo/getVideoVtt";
JSONObject message = new JSONObject();
message.put("courseId", couirseId);
message.put("videoId", cc.getId());

View File

@@ -119,6 +119,9 @@ jasypt:
boe:
domain: http://10.251.186.27
kjb:
aicoreUrl: http://10.251.186.27:8088
ok:
http:
connect-timeout: 30