|
@@ -1,26 +1,23 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
-import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.CourseScheduleDao;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseScheduleStudentDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentCourseInfoDto;
|
|
|
import com.ym.mec.biz.dal.dto.UserMusicGroupQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.CourseDetailQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.ImGroupNoticeQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentPayLogQueryInfo;
|
|
|
import com.ym.mec.biz.service.ClassGroupService;
|
|
|
import com.ym.mec.biz.service.ImGroupNoticeService;
|
|
|
+import com.ym.mec.biz.service.SysUserService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RequestMapping("course")
|
|
|
@Api(tags = "课程服务")
|
|
@@ -30,7 +27,7 @@ public class CourseController extends BaseController {
|
|
|
@Autowired
|
|
|
private ClassGroupService classGroupService;
|
|
|
@Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ private SysUserService sysUserService;
|
|
|
@Autowired
|
|
|
private ImGroupNoticeService imGroupNoticeService;
|
|
|
|
|
@@ -40,21 +37,13 @@ public class CourseController extends BaseController {
|
|
|
@ApiOperation("获取学生所购买课程列表")
|
|
|
@GetMapping(value = "/queryUserMusicGroups")
|
|
|
public Object queryCoursePage(UserMusicGroupQueryInfo queryInfo){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("获取用户信息失败");
|
|
|
- }
|
|
|
- return succeed(classGroupService.queryCoursePage(queryInfo,sysUser.getId()));
|
|
|
+ return succeed(classGroupService.queryCoursePage(queryInfo,sysUserService.getUserId()));
|
|
|
}
|
|
|
|
|
|
@ApiOperation("获取学生所购买课程列表")
|
|
|
@GetMapping(value = "/queryRemainCourseNum")
|
|
|
public Object queryRemainCourseNum(){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("获取用户信息失败");
|
|
|
- }
|
|
|
- List<StudentCourseInfoDto> list = courseScheduleDao.findUserSurplusCourseInfoByGroup(null, null, sysUser.getId());
|
|
|
+ List<StudentCourseInfoDto> list = courseScheduleDao.findUserSurplusCourseInfoByGroup(null, null, sysUserService.getUserId());
|
|
|
if(list == null){
|
|
|
return succeed(0);
|
|
|
}
|
|
@@ -64,11 +53,7 @@ public class CourseController extends BaseController {
|
|
|
@ApiOperation("获取学员所有聊天群组")
|
|
|
@GetMapping(value = "/queryUserGroups")
|
|
|
public Object queryUserGroups(String search){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
- return failed("获取用户信息失败");
|
|
|
- }
|
|
|
- return succeed(classGroupService.queryUserGroups(sysUser.getId(),search));
|
|
|
+ return succeed(classGroupService.queryUserGroups(sysUserService.getUserId(),search));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取最新一条群公告")
|
|
@@ -95,11 +80,14 @@ public class CourseController extends BaseController {
|
|
|
@ApiOperation(value = "分页获取学员购买记录")
|
|
|
@PostMapping("/queryStudentPayLog")
|
|
|
public Object queryStudentPayLog(StudentPayLogQueryInfo studentPayLogQueryInfo){
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null || sysUser.getId() == null){
|
|
|
- return failed("获取用户失败");
|
|
|
- }
|
|
|
- studentPayLogQueryInfo.setUserId(sysUser.getId());
|
|
|
+ studentPayLogQueryInfo.setUserId(sysUserService.getUserId());
|
|
|
return succeed(classGroupService.queryStudentPayLog(studentPayLogQueryInfo));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据课程组编号,获取课程列表")
|
|
|
+ @PostMapping("/queryDetailList")
|
|
|
+ public HttpResponseResult<List<CourseScheduleStudentDto>> queryDetailList(@RequestBody CourseDetailQueryInfo courseDetailQueryInfo){
|
|
|
+ courseDetailQueryInfo.setUserId(sysUserService.getUserId());
|
|
|
+ return succeed(courseScheduleDao.queryDetailList(courseDetailQueryInfo));
|
|
|
+ }
|
|
|
}
|