一、讲师管理
1、新增讲师
接口url:/eduservice/teacher/addTeacher
请求方式:post
请求参数:
public class TeacherVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "讲师姓名")
private String name;
@ApiModelProperty(value = "讲师简介")
private String intro;
@ApiModelProperty(value = "讲师资历,一句话说明讲师")
private String career;
@ApiModelProperty(value = "头衔 1高级讲师 2首席讲师")
private Integer level;
@ApiModelProperty(value = "讲师头像")
private String avatar;
@ApiModelProperty(value = "排序")
private Integer sort;
}
响应参数:
{
"success":true,
"code":20000,
"message":"成功",
"data":{}
}
2、编辑讲师
请求地址:/eduservice/teacher/updateTeacher
请求方式:post
请求参数:
public class EduTeacher implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "讲师ID")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
private String id;
@ApiModelProperty(value = "讲师姓名")
private String name;
@ApiModelProperty(value = "讲师简介")
private String intro;
@ApiModelProperty(value = "讲师资历,一句话说明讲师")
private String career;
@ApiModelProperty(value = "头衔 1高级讲师 2首席讲师")
private Integer level;
@ApiModelProperty(value = "讲师头像")
private String avatar;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除")
@TableLogic
private Boolean isDeleted;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date gmtCreate;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gmtModified;
}
响应参数:
{
"success":true,
"code":20000,
"message":"成功",
"data":{}
}
3、删除讲师
请求url:/eduservice/teacher/{id}
请求方式:delete
请求参数:
响应参数:
{
"success":true,
"code":20000,
"message":"成功",
"data":{}
}
4、讲师列表查询
请求url:/eduservice/teacher/pageTeacherCondition/{current}/{limit}
请求方式:get
请求参数:
@Data
public class TeacherQuery {
@ApiModelProperty(value = "教师名称,模糊查询")
private String name;
@ApiModelProperty(value = "头衔 1高级讲师 2首席讲师")
private Integer level;
@ApiModelProperty(value = "查询开始时间", example = "2019-01-01 10:10:10")
private String begin;//注意,这里使用的是String类型,前端传过来的数据无需进行类型转换
@ApiModelProperty(value = "查询结束时间", example = "2019-12-01 10:10:10")
private String end;
}
响应参数:
public class TeacherResp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "讲师ID")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
private String id;
@ApiModelProperty(value = "讲师姓名")
private String name;
@ApiModelProperty(value = "讲师资历,一句话说明讲师")
private String career;
@ApiModelProperty(value = "头衔 1高级讲师 2首席讲师")
private Integer level;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除")
@TableLogic
private Boolean isDeleted;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date gmtCreate;
}
5、讲师详情查询
请求url:/eduservice/teachergetTeacher/{id}
请求方式:get
请求参数:
响应参数:
public class EduTeacher implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "讲师ID")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
private String id;
@ApiModelProperty(value = "讲师姓名")
private String name;
@ApiModelProperty(value = "讲师简介")
private String intro;
@ApiModelProperty(value = "讲师资历,一句话说明讲师")
private String career;
@ApiModelProperty(value = "头衔 1高级讲师 2首席讲师")
private Integer level;
@ApiModelProperty(value = "讲师头像")
private String avatar;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除")
@TableLogic
private Boolean isDeleted;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date gmtCreate;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gmtModified;
}
二、课程分类
1、导入课程分类
请求url:/eduservice/subject/addSubject
请求方式:post
请求参数:
MultipartFile file
2、课程分类列表查询-树形结构
请求url:/eduservice/subject/getAllSubject
请求方式:get
请求参数:无
响应参数:
{
"success": true,
"code": 20000,
"message": "成功",
"data": {
"list": [{
"id": "1178214681118568449",
"title": "后端开发",
"children": [{
"id": "1178214681139539969",
"title": "Java"
}, {
"id": "1178585108407984130",
"title": "Python"
}, {
"id": "1433788723642335233",
"title": "c++"
}]
}, {
"id": "1178214681181483010",
"title": "前端开发",
"children": [{
"id": "1178214681210843137",
"title": "JavaScript"
}, {
"id": "1178585108454121473",
"title": "HTML/CSS"
}, {
"id": "1433788723554254849",
"title": "vue"
}, {
"id": "1433788723604586497",
"title": "jquery"
}]
}]
}
}
三、课程管理
1、课程基本信息
1.1 添加课程基本信息
请求url:/eduservice/course/addCourseInfo
请求方式:post
请求参数:
package com.atguigu.eduservice.entity.vo;
@Data
public class CourseInfoVo {
@ApiModelProperty(value = "课程ID")
private String id;
@ApiModelProperty(value = "课程讲师ID")
private String teacherId;
@ApiModelProperty(value = "课程专业ID")
private String subjectId;
@ApiModelProperty(value = "一级分类级ID")
private String subjectParentId;
@ApiModelProperty(value = "课程标题")
private String title;
@ApiModelProperty(value = "课程销售价格,设置为0则可免费观看")
// 0.01
private BigDecimal price;
@ApiModelProperty(value = "总课时")
private Integer lessonNum;
@ApiModelProperty(value = "课程封面图片路径")
private String cover;
@ApiModelProperty(value = "课程简介")
private String description;
}
响应参数:
1.2 编辑课程基本信息
请求url:/eduservice/course/updateCourseInfo
请求方式:post
请求参数:
package com.atguigu.eduservice.entity.vo;
@Data
public class CourseInfoVo {
@ApiModelProperty(value = "课程ID")
private String id;
@ApiModelProperty(value = "课程讲师ID")
private String teacherId;
@ApiModelProperty(value = "课程专业ID")
private String subjectId;
@ApiModelProperty(value = "一级分类级ID")
private String subjectParentId;
@ApiModelProperty(value = "课程标题")
private String title;
@ApiModelProperty(value = "课程销售价格,设置为0则可免费观看")
// 0.01
private BigDecimal price;
@ApiModelProperty(value = "总课时")
private Integer lessonNum;
@ApiModelProperty(value = "课程封面图片路径")
private String cover;
@ApiModelProperty(value = "课程简介")
private String description;
}
响应参数:
1.3 查看课程基本信息
请求url:/eduservice/course/getCourseInfo/{courseId}
请求方式:get
请求参数:
响应参数:
2、课程大纲
2.1 根据课程ID查看课程大纲信息
请求url:/eduservice/chapter/getChapterVideo/{courseId}
请求方式:get
请求参数:
响应参数:
2.2 编辑课程大纲信息11
请求url:/eduservice/course/{current}/{limit}
请求方式:post
请求参数:
响应参数:
3、课程章节
3.1 新增章节
请求url:/eduservice/chapter/addChapter
请求方式:post
请求参数:
响应参数:
3.2 编辑章节
请求url:/eduservice/chapter/updateChapter
请求方式:post
请求参数:
响应参数:
3.3 根据章节ID查询详情
请求url:/eduservice/chapter/getChapterInfo/{chapterId}
请求方式:get
请求参数:
响应参数:
3.4 删除章节
请求url:/eduservice/chapter/{chapterId}
请求方式:delete
请求参数:
响应参数:
4、课程小节
4.1 新增小节
请求url:/eduservice/video/addVideo
请求方式:post
请求参数:
package com.atguigu.eduservice.entity;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="EduVideo对象", description="课程视频")
public class EduVideo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "视频ID")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
private String id;
@ApiModelProperty(value = "课程ID")
private String courseId;
@ApiModelProperty(value = "章节ID")
private String chapterId;
@ApiModelProperty(value = "节点名称")
private String title;
@ApiModelProperty(value = "云端视频资源")
private String videoSourceId;
@ApiModelProperty(value = "原始文件名称")
private String videoOriginalName;
@ApiModelProperty(value = "排序字段")
private Integer sort;
@ApiModelProperty(value = "播放次数")
private Long playCount;
@ApiModelProperty(value = "是否可以试听:0收费 1免费")
private Boolean isFree;
@ApiModelProperty(value = "视频时长(秒)")
private Float duration;
@ApiModelProperty(value = "Empty未上传 Transcoding转码中 Normal正常")
private String status;
@ApiModelProperty(value = "视频源文件大小(字节)")
private Long size;
@ApiModelProperty(value = "乐观锁")
private Long version;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date gmtCreate;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gmtModified;
}
响应参数:
4.2 编辑小节
请求url:/eduservice/video/updateVideo
请求方式:post
请求参数:
package com.atguigu.eduservice.entity;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="EduVideo对象", description="课程视频")
public class EduVideo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "视频ID")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
private String id;
@ApiModelProperty(value = "课程ID")
private String courseId;
@ApiModelProperty(value = "章节ID")
private String chapterId;
@ApiModelProperty(value = "节点名称")
private String title;
@ApiModelProperty(value = "云端视频资源")
private String videoSourceId;
@ApiModelProperty(value = "原始文件名称")
private String videoOriginalName;
@ApiModelProperty(value = "排序字段")
private Integer sort;
@ApiModelProperty(value = "播放次数")
private Long playCount;
@ApiModelProperty(value = "是否可以试听:0收费 1免费")
private Boolean isFree;
@ApiModelProperty(value = "视频时长(秒)")
private Float duration;
@ApiModelProperty(value = "Empty未上传 Transcoding转码中 Normal正常")
private String status;
@ApiModelProperty(value = "视频源文件大小(字节)")
private Long size;
@ApiModelProperty(value = "乐观锁")
private Long version;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date gmtCreate;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date gmtModified;
}
响应参数:
4.3 删除小节,删除对应阿里云视频
请求url:/eduservice/video/{id}
请求方式:post
请求参数:
响应参数:
5、课程信息
5.1 课程列表查询
请求url:/eduservice/course/{current}/{limit}
请求方式:post
请求参数:
@Data
public class CourseQuery {
@ApiModelProperty(value = "课程标题,模糊查询")
private String title;
@ApiModelProperty(value = "课程状态 Draft未发布 Normal已发布")
private String status;
}
5.2 课程最终发布(修改课程状态)
请求url:/eduservice/course/publishCourse/{id}
请求方式:post
请求参数:
响应参数:
5.3 删除课程信息
请求url:/eduservice/course/{courseId}
请求方式:delete
请求参数:
响应参数: