package cn.com.ctop.toutiao.modules.material.service.impl;

import cn.com.ctop.toutiao.modules.material.entity.BytedanceImageInfo;
import cn.com.ctop.toutiao.modules.material.mapper.BytedanceImageInfoMapper;
import cn.com.ctop.toutiao.modules.material.service.IBytedanceImageInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * 头条图片素材
 * @author jeecg-boot
 * @date   2020-08-01
 * @version V1.0
 */
@Service
@Slf4j
public class BytedanceImageInfoServiceImpl extends ServiceImpl<BytedanceImageInfoMapper, BytedanceImageInfo> implements IBytedanceImageInfoService {
    @Resource
    private BytedanceImageInfoMapper imageInfoMapper;
    @Override
    public void replaceBatch(List<BytedanceImageInfo> videoInfoList) {
        imageInfoMapper.replaceBatch(videoInfoList);
    }

    @Override
    public void updateType(Long accountId) {
        //大图竖图 -2
        imageInfoMapper.updateImageVerticalType(accountId);
        //大图横图 -1
        imageInfoMapper.updateImageHorizonType(accountId);
        //开屏-3
        imageInfoMapper.updateImageUnionType(accountId);
        log.info("清洗头条图片类型成功=====>>>>>accountId:{}",accountId);
        //开屏 或者 竖图 -4
        //imageInfoMapper.updateImageUnionIOrVerticalType();
    }
}
