diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseAuditApi.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseAuditApi.java index d80843db..e0e70344 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseAuditApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseAuditApi.java @@ -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); } diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseFullTextApi.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseFullTextApi.java index 9ec3f4e9..3ec49e31 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseFullTextApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/api/CourseFullTextApi.java @@ -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(); diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CourseServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CourseServiceImpl.java index adf8ff59..80ca42a3 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CourseServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/service/impl/CourseServiceImpl.java @@ -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(); 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 c7ac32b5..94b5c547 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 @@ -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()); diff --git a/servers/boe-server-all/src/main/resources/application-test.yml b/servers/boe-server-all/src/main/resources/application-test.yml index 7872413a..0ab7a8cc 100644 --- a/servers/boe-server-all/src/main/resources/application-test.yml +++ b/servers/boe-server-all/src/main/resources/application-test.yml @@ -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