package com.sptg.ad.biz.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.sptg.ad.api.entity.AdPushContentImg;
import com.sptg.ad.biz.mapper.AdPushContentImgMapper;
import com.sptg.ad.biz.service.AdPushContentImgServiceInterface;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * title: AdContentImgServiceImpl
 * package: com.sptg.ad.biz.security.impl
 * description: 广告发布图片-接口实现类
 *
 *               
 *                 
 */
@Service
public class AdPushContentImgServiceImpl extends ServiceImpl<AdPushContentImgMapper, AdPushContentImg> implements AdPushContentImgServiceInterface {


    @Override
    @Transactional(rollbackFor = Throwable.class)
    public ResultBean<Boolean> addAdPushContentImg(List<AdPushContentImg> adPushTaskImgs) {
        return new ResultBean<>(ResultEnum.SUCCESS,this.insertBatch(adPushTaskImgs));
    }

    @Override
    public List<AdPushContentImg> getAdPushContentImgs(Long pushContentId) {
        Wrapper<AdPushContentImg> wrapper = new EntityWrapper<>();
        wrapper.eq("l_push_content_id",pushContentId);
        return this.selectList(wrapper);
    }
}
