|
|
|
@ -156,21 +156,27 @@ public class SeCourseFavourServiceImpl extends ServiceImpl<SeCourseFavourMapper, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public CoursesVO queryNewCollect(String userId) { |
|
|
|
|
public List<CoursesVO> queryNewCollect(String userId) { |
|
|
|
|
String roleId = umsUserMapper.getbyIdRoleId(userId); |
|
|
|
|
CoursesVO coursesVO = new CoursesVO(); |
|
|
|
|
List<Courses> coursesList = new ArrayList<>(); |
|
|
|
|
if (roleId.equals("1")){ |
|
|
|
|
//老师
|
|
|
|
|
String courseId = seCourseFavourMapper.queryAllNewCollectCourse(); |
|
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
|
BeanUtil.copyProperties(courses,coursesVO); |
|
|
|
|
return coursesVO; |
|
|
|
|
List<String> courseIdList = seCourseFavourMapper.queryAllNewCollectCourse(); |
|
|
|
|
for (String courseId : courseIdList) { |
|
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
|
coursesList.add(courses); |
|
|
|
|
} |
|
|
|
|
List<CoursesVO> coursesVOList = BeanUtil.copyToList(coursesList, CoursesVO.class); |
|
|
|
|
return coursesVOList; |
|
|
|
|
}else if (roleId.equals("2")){ |
|
|
|
|
//学生
|
|
|
|
|
String courseId = seCourseFavourMapper.queryStudentNewCollectCourse(userId); |
|
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
|
BeanUtil.copyProperties(courses,coursesVO); |
|
|
|
|
return coursesVO; |
|
|
|
|
List<String> courseIdList = seCourseFavourMapper.queryStudentNewCollectCourse(userId); |
|
|
|
|
for (String courseId : courseIdList) { |
|
|
|
|
Courses courses = coursesMapper.selectById(courseId); |
|
|
|
|
coursesList.add(courses); |
|
|
|
|
} |
|
|
|
|
List<CoursesVO> coursesVOList = BeanUtil.copyToList(coursesList,CoursesVO.class); |
|
|
|
|
return coursesVOList; |
|
|
|
|
}else { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|