|  |  |  | 
|---|
|  |  |  | package cc.mrbird.febs.mall.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.dto.NewsListDto; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallNewsCategory; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallNewsInfo; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.PlatformBanner; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.mapper.MallNewsCategoryMapper; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.mapper.MallNewsInfoMapper; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.mapper.PlatformBannerMapper; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.service.IApiMallNewsService; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.vo.NewsListVo; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | 
|---|
|  |  |  | public class ApiMallNewsServiceImpl extends ServiceImpl<MallNewsInfoMapper, MallNewsInfo> implements IApiMallNewsService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final MallNewsCategoryMapper mallNewsCategoryMapper; | 
|---|
|  |  |  | private final PlatformBannerMapper platformBannerMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<MallNewsCategory> findNewsCategoryList() { | 
|---|
|  |  |  | 
|---|
|  |  |  | IPage<NewsListVo> pageList = this.baseMapper.selectNewsVoInPage(page, mallNewsInfo); | 
|---|
|  |  |  | return pageList.getRecords(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public FebsResponse findAllBanner() { | 
|---|
|  |  |  | QueryWrapper<PlatformBanner> queryWrapper = new QueryWrapper<>(); | 
|---|
|  |  |  | queryWrapper.orderByAsc("is_top"); | 
|---|
|  |  |  | List<PlatformBanner> paymentMethodList = platformBannerMapper.selectList(queryWrapper); | 
|---|
|  |  |  | return new FebsResponse().success().data(paymentMethodList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|