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.AdPushTaskDetails;
import com.sptg.ad.biz.mapper.AdPushTaskDetailsMapper;
import com.sptg.ad.biz.service.AdPushTaskDetailsServiceInterface;
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 AdPushTaskDetailsServiceImpl extends ServiceImpl<AdPushTaskDetailsMapper, AdPushTaskDetails> implements AdPushTaskDetailsServiceInterface {

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

    @Override
    public List<AdPushTaskDetails> getAdPushTaskDetails(Long adPushTaskId) {
        Wrapper<AdPushTaskDetails> wrapper = new EntityWrapper<>();
        wrapper.eq("l_task_id",adPushTaskId);
        return this.selectList(wrapper);
    }
}
