| | |
| | | import com.xinquan.common.core.utils.page.CollUtils; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.course.api.domain.Course; |
| | | import com.xinquan.course.api.domain.CourseCategory; |
| | | import com.xinquan.course.api.domain.CourseDTO; |
| | | import com.xinquan.course.api.feign.RemoteCourseService; |
| | | import com.xinquan.system.api.domain.vo.BannerVO; |
| | | import com.xinquan.system.domain.Banner; |
| | | import com.xinquan.system.mapper.BannerMapper; |
| | |
| | | import java.util.Objects; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements BannerService { |
| | | |
| | | @Resource |
| | | private RemoteCourseService remoteCourseService; |
| | | /** |
| | | * 获取轮播图列表 |
| | | * |
| | |
| | | return PageDTO.empty(page); |
| | | } |
| | | for (Banner record : page.getRecords()) { |
| | | |
| | | if (record.getCourseId()!=null){ |
| | | Course data = remoteCourseService.getCourseById(record.getCourseId()).getData(); |
| | | if (data!=null){ |
| | | record.setCourseTitle(data.getCourseTitle()); |
| | | record.setCoverUrl(data.getCoverUrl()); |
| | | record.setTutor(data.getTutor()); |
| | | record.setPrice(data.getGeneralPrice()); |
| | | if (data.getCateId()!=null){ |
| | | CourseCategory data1 = remoteCourseService.getCategoryById(data.getCateId().toString()).getData(); |
| | | record.setCate(data1.getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return PageDTO.of(page, Banner.class); |
| | | } |