|
@@ -2,11 +2,17 @@ package com.zhentao.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.zhentao.controller.Course.dto.CourseDatailsDto;
|
|
|
import com.zhentao.controller.Course.dto.CourseDto;
|
|
|
+import com.zhentao.domain.CourseDatails;
|
|
|
import com.zhentao.domain.Courses;
|
|
|
+import com.zhentao.domain.Shop;
|
|
|
import com.zhentao.dto.Result;
|
|
|
+import com.zhentao.service.CourseDatailsService;
|
|
|
import com.zhentao.service.CoursesService;
|
|
|
import com.zhentao.mapper.CoursesMapper;
|
|
|
+import com.zhentao.service.ShopService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -19,7 +25,11 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses>
|
|
|
implements CoursesService{
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private ShopService shopService;
|
|
|
+ @Autowired
|
|
|
+ private CourseDatailsService courseDatailsService;
|
|
|
+//查询所有的课程
|
|
|
@Override
|
|
|
public Result findAll(CourseDto courseDto) {
|
|
|
QueryWrapper<Courses> queryWrapper = new QueryWrapper<>();
|
|
@@ -28,6 +38,16 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses>
|
|
|
List<Courses> list = this.list(queryWrapper);
|
|
|
return Result.OK("查询成功",list);
|
|
|
}
|
|
|
+//查询详情信息
|
|
|
+ @Override
|
|
|
+ public Result Cha(CourseDatailsDto courseDatailsDto) {
|
|
|
+ Courses byId = this.getById(courseDatailsDto.getId());
|
|
|
+ Shop byId1 = shopService.getById(byId.getStoreId());
|
|
|
+ CourseDatails byId2 = courseDatailsService.getById(byId.getCategoryId());
|
|
|
+ byId.setShop(byId1);
|
|
|
+ byId.setCourseDatails(byId2);
|
|
|
+ return Result.OK("查询成功",byId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|