package jnpf.tempmodule.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jnpf.entity.AppBanner;
import jnpf.model.tempmodule.AppBannerVo;
import jnpf.tempmodule.mapper.AppBannerMapper;
import jnpf.tempmodule.service.AppBannerService;
import jnpf.util.JsonUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * banner服务实现
 *
 * @author yanwenfu
 * @create 2023-10-10
 */
@Service
public class AppBannerServiceImpl implements AppBannerService {

    @Resource
    private AppBannerMapper appBannerMapper;

    @Override
    public List<AppBannerVo> getAppBannerList() {

        LambdaQueryWrapper<AppBanner> queryWrapper = new LambdaQueryWrapper<AppBanner>()
                .orderByAsc(AppBanner::getSort);
        List<AppBanner> list = appBannerMapper.selectList(queryWrapper);
        return JsonUtil.getJsonToList(list, AppBannerVo.class);
    }
}
