|
@@ -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;
|
|
|
|
|
@@ -12,9 +13,12 @@ import com.futu.course.orders.domain.OrderItem;
|
|
|
import com.futu.course.orders.mapper.Order1Mapper;
|
|
|
import com.futu.course.orders.mapper.OrderItemMapper;
|
|
|
import com.futu.course.user.domain.User;
|
|
|
-import org.elasticsearch.common.util.LongHash;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
+import com.futu.course.shop.service.impl.ShopServiceImpl;
|
|
|
+import com.futu.course.shop.service.impl.TeacherServiceImpl;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
@@ -39,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() {
|
|
@@ -63,6 +72,14 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
|
|
|
|
|
|
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|