|
@@ -3,14 +3,11 @@ package com.yonge.cooleshow.teacher.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;
|
|
|
import com.dayaedu.cbs.openfeign.wrapper.courseware.CbsLessonCoursewareWrapper;
|
|
|
import com.microsvc.toolkit.common.response.paging.QueryInfo;
|
|
|
-import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
-import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
-import com.yonge.cooleshow.biz.dal.entity.Teacher;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.TeacherService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TenantAlbumMusicService;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareDetailWrapper;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.LessonCoursewareWrapper;
|
|
@@ -22,11 +19,10 @@ import com.yonge.toolset.mybatis.support.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.http.HttpStatus;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -42,29 +38,25 @@ import java.util.List;
|
|
|
@Api(tags = "机构专辑曲目 API接口")
|
|
|
public class TenantAlbumSheetController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private TenantAlbumMusicService tenantAlbumMusicService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private SysUserFeignService sysUserFeignService;
|
|
|
+ @Resource
|
|
|
+ private SysUserService sysUserService;
|
|
|
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private TeacherService teacherService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private CoursewareFeignService coursewareFeignService;
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "分页查询")
|
|
|
@PostMapping("/page")
|
|
|
public HttpResponseResult<PageInfo<TenantAlbumMusicWrapper.StudentTenantAlbumMusic>> page(@RequestBody @Validated TenantAlbumMusicWrapper.StudentTenantAlbumMusicQuery query) {
|
|
|
- SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
- if (user == null || null == user.getId()) {
|
|
|
- return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
- }
|
|
|
+// SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
+// if (user == null || null == user.getId()) {
|
|
|
+// return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+// }
|
|
|
|
|
|
- Teacher teacher = teacherService.getById(user.getId());
|
|
|
+// Teacher teacher = teacherService.getById(user.getId());
|
|
|
// query.setTenantId(Optional.ofNullable(teacher.getTenantId()).orElse(-1L));
|
|
|
query.setClientType(ClientEnum.TEACHER);
|
|
|
IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page = tenantAlbumMusicService.selectPage(QueryInfo.getPage(query), query);
|
|
@@ -76,11 +68,11 @@ public class TenantAlbumSheetController extends BaseController {
|
|
|
@PostMapping("/getLessonCoursewareDetail")
|
|
|
public HttpResponseResult<LessonCoursewareWrapper.LessonCourseware> getLessonCoursewareDetail(@RequestBody @Valid LessonCoursewareWrapper.LessonCourseQuery query){
|
|
|
query.setClient(ClientEnum.TEACHER);
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (sysUser == null || null == sysUser.getId()) {
|
|
|
- return failed("用户信息获取失败");
|
|
|
- }
|
|
|
- query.setUserId(sysUser.getId());
|
|
|
+// SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+// if (sysUser == null || null == sysUser.getId()) {
|
|
|
+// return failed("用户信息获取失败");
|
|
|
+// }
|
|
|
+ query.setUserId(sysUserService.getUserId());
|
|
|
LessonCoursewareWrapper.LessonCourseware lessonCourseware = tenantAlbumMusicService.getLessonCoursewareDetail(query);
|
|
|
return succeed(lessonCourseware);
|
|
|
}
|