|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.futu.course.common.entity.R;
|
|
|
import com.futu.course.course.domain.Course;
|
|
|
+import com.futu.course.course.dto.CourseByIdDto;
|
|
|
import com.futu.course.course.service.CourseService;
|
|
|
import com.futu.course.course.mapper.CourseMapper;
|
|
|
|
|
@@ -42,6 +43,11 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
private OrderItemMapper orderItemMapper;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TeacherServiceImpl teacherService;
|
|
|
+ @Autowired
|
|
|
+ private ShopServiceImpl shopService;
|
|
|
+
|
|
|
// 查询首页的课程
|
|
|
@Override
|
|
|
public R findAll() {
|
|
@@ -66,17 +72,15 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- @Autowired
|
|
|
- TeacherServiceImpl teacherService;
|
|
|
- @Autowired
|
|
|
- ShopServiceImpl shopService;
|
|
|
- public Course CourseGetOneById(@RequestParam Long id){
|
|
|
- Course byId = this.getById(id);
|
|
|
+ public Course CourseGetOneById(@RequestParam CourseByIdDto id){
|
|
|
+ Course byId = this.getById(id.getId());
|
|
|
byId.setShop(shopService.getById(byId.getShopId()));
|
|
|
byId.setTeacher(teacherService.getById(byId.getTeacherId()));
|
|
|
return byId;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|