|
@@ -1,5 +1,6 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.dayaedu.cbs.openfeign.client.CoursewareFeignService;
|
|
|
import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareDetailWrapper;
|
|
@@ -14,6 +15,7 @@ import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.page.PageUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RequestMapping("${app-config.url.student:}/lessonCourseware")
|
|
@@ -51,17 +54,20 @@ public class LessonCoursewareController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "获取课件关联的课程列表")
|
|
|
@GetMapping("/getLessonCoursewareCourseList/{id}")
|
|
|
- public HttpResponseResult<List<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail>> getLessonCoursewareCourseList(@PathVariable("id") Long id){
|
|
|
- CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail cbsQuery =
|
|
|
- new CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail();
|
|
|
- cbsQuery.setLessonCoursewareId(id);
|
|
|
- return succeed(coursewareFeignService.lessonCoursewareDetailList(cbsQuery).feignData());
|
|
|
+ public HttpResponseResult<List<LessonCoursewareWrapper.CourseScheduleCoursewareDetail>> getLessonCoursewareCourseList(@PathVariable("id") Long id){
|
|
|
+ List<CbsLessonCoursewareWrapper.CourseScheduleCoursewareDetail> courseScheduleCoursewareDetails = coursewareFeignService.coursewareDetail(id).feignData();
|
|
|
+ if (CollectionUtils.isNotEmpty(courseScheduleCoursewareDetails)) {
|
|
|
+ String jsonString = JSONObject.toJSONString(courseScheduleCoursewareDetails);
|
|
|
+ List<LessonCoursewareWrapper.CourseScheduleCoursewareDetail> courseScheduleCoursewareDetailList = JSONObject.parseArray(jsonString, LessonCoursewareWrapper.CourseScheduleCoursewareDetail.class);
|
|
|
+ return succeed(courseScheduleCoursewareDetailList);
|
|
|
+ }
|
|
|
+ return succeed(new ArrayList<>());
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取课程详情")
|
|
|
@GetMapping("/getLessonCourseDetail/{id}")
|
|
|
- public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") Long id){
|
|
|
- return succeed(coursewareFeignService.lessonCoursewareDetailDetail(id).feignData());
|
|
|
+ public HttpResponseResult<CbsLessonCoursewareDetailWrapper.LessonCoursewareDetail> getLessonCourseDetail(@PathVariable("id") String id){
|
|
|
+ return succeed(coursewareFeignService.lessonCoursewareDetailDetail(Long.parseLong(id)).feignData());
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取课件关联的声部列表")
|