|
@@ -1,21 +1,27 @@
|
|
|
package com.yonge.cooleshow.teacher.controller;
|
|
|
|
|
|
|
|
|
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
+import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.CheckCourseTimeDto;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.LiveCourseGroupDto;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.CourseTimeEntity;
|
|
|
import com.yonge.cooleshow.biz.dal.service.CourseGroupService;
|
|
|
+import com.yonge.cooleshow.biz.dal.support.WrapperUtil;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.CourseGroupVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.LiveCourseInfoVo;
|
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
+import com.yonge.toolset.base.exception.BizException;
|
|
|
import com.yonge.toolset.base.page.PageInfo;
|
|
|
import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
/**
|
|
|
* 课程组表(CourseGroup)表控制层
|
|
@@ -32,6 +38,8 @@ public class TeacherCourseGroupController extends BaseController {
|
|
|
*/
|
|
|
@Resource
|
|
|
private CourseGroupService courseGroupService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@ApiOperation("直播课详情")
|
|
|
@GetMapping("/queryLiveCourseInfo")
|
|
@@ -49,6 +57,9 @@ public class TeacherCourseGroupController extends BaseController {
|
|
|
@ApiOperation("分页查询直播课课程组列表")
|
|
|
@PostMapping("/queryPageCourseGroup")
|
|
|
public HttpResponseResult<PageInfo<CourseGroupVo>> queryPageLiveCourseGroup(@RequestBody Map<String, Object> param) {
|
|
|
+ Long teacherId = WrapperUtil.toLong(param, "teacherId");
|
|
|
+ teacherId = Optional.ofNullable(teacherId).orElseGet(() -> getSysUser().getId());
|
|
|
+ param.put("teacherId", teacherId);
|
|
|
return succeed(courseGroupService.queryPageLiveCourseGroup(param));
|
|
|
}
|
|
|
|
|
@@ -85,5 +96,9 @@ public class TeacherCourseGroupController extends BaseController {
|
|
|
return succeed(courseGroupService.getLiveLockTimeCache(teacherId).get(teacherId));
|
|
|
}
|
|
|
|
|
|
+ private SysUser getSysUser() {
|
|
|
+ return Optional.ofNullable(sysUserFeignService.queryUserInfo())
|
|
|
+ .orElseThrow(() -> new BizException("用户不存在"));
|
|
|
+ }
|
|
|
}
|
|
|
|