|
@@ -172,7 +172,7 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
case '2':
|
|
|
return convertSearchCompetitionVOPage(searchDTO);
|
|
|
case '3':
|
|
|
- return new Page<>();
|
|
|
+ return convertSearchInstructorVOPage(searchDTO);
|
|
|
}
|
|
|
return new Page<>();
|
|
|
}
|
|
@@ -257,12 +257,26 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
* @Author SheepHy
|
|
|
* @Description //TODO
|
|
|
* @Date 14:43 2025/7/7
|
|
|
- * @Param
|
|
|
- * @return
|
|
|
+ * @Param searchDTO {@link SearchDTO}
|
|
|
+ * @return Page<SearchVO.SearchInstructorVO>
|
|
|
**/
|
|
|
private Page<SearchVO.SearchInstructorVO> convertSearchInstructorVOPage(SearchDTO searchDTO) {
|
|
|
Page<SearchVO.SearchInstructorVO> page = new Page<>(searchDTO.getCurrent(), searchDTO.getSize());
|
|
|
-// Page<SearchVO.SearchInstructorVO> searchInstructorVOPage = appInstructorMapper.convertSearchInstructorVOPage(page, searchDTO);
|
|
|
- return page;
|
|
|
+ Page<SearchVO.SearchInstructorVO> searchInstructorVOPage = appInstructorMapper.convertSearchInstructorVOPage(page, searchDTO);
|
|
|
+ searchInstructorVOPage.getRecords().forEach(instructorVO -> {
|
|
|
+ // 获取该教练的课程(最多取2个)
|
|
|
+ List<AppCourses> courses = appCoursesMapper.selectList(
|
|
|
+ Wrappers.<AppCourses>lambdaQuery().eq(AppCourses::getUserId, instructorVO.getUserId()).last("LIMIT 2"));
|
|
|
+ List<SearchVO.SearchCoursesVO> courseInfoVOS = courses.stream()
|
|
|
+ .map(course -> {
|
|
|
+ SearchVO.SearchCoursesVO vo = new SearchVO.SearchCoursesVO();
|
|
|
+ BeanUtils.copyProperties(vo, course);
|
|
|
+ return vo;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ instructorVO.setKm(0.0)
|
|
|
+ .setCourseList(courseInfoVOS);
|
|
|
+ });
|
|
|
+ return searchInstructorVOPage;
|
|
|
}
|
|
|
}
|