1.课程管理-课程大纲列表
1.1课程相关表间关系
1.2编辑章节和课时实体类
package com.yunxun.eduservice.entity.chapter;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(value = "课时信息")
public class VideoVo {
private String id;
private String title;
private Boolean free;
}
```java
package com.yunxun.eduservice.entity.chapter;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
@ApiModel(value = "章节信息")
public class ChapterVo {
private String id;
private String title;
private List<VideoVo> children = new ArrayList<>();
}
1.3编辑章节Controlle
package com.yunxun.eduservice.controller;
import com.yunxun.commonutils.Result;
import com.yunxun.eduservice.entity.chapter.ChapterVo;
import com.yunxun.eduservice.service.EduChapterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/eduservice/chapter")
@CrossOrigin
public class EduChapterController {
@Autowired
private EduChapterService chapterService;
@GetMapping("getChapterVideo/{courseId}")
public Result getChapterVideo(@PathVariable String couresId){
List<ChapterVo> list = chapterService.getChapterVideoByCourseId(couresId);
return Result.ok().data("allChapterVideo",list);
}
}