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