package cn.com.ctop.kuaishou.modules.dimension.service.impl;

import cn.com.ctop.kuaishou.modules.dimension.entity.KuaiShouDimensionMaterial;
import cn.com.ctop.kuaishou.modules.dimension.mapper.KuaiShouDimensionMaterialMapper;
import cn.com.ctop.kuaishou.modules.dimension.service.IKuaiShouDimensionMaterialService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 多维度测试素材列表
 *
 * @author jeecg-boot
 * 2021-07-23
 * @version V1.0
 */
@Service
public class KuaiShouDimensionMaterialServiceImpl extends ServiceImpl<KuaiShouDimensionMaterialMapper, KuaiShouDimensionMaterial> implements IKuaiShouDimensionMaterialService {
    @Autowired
    private KuaiShouDimensionMaterialMapper dimensionMaterialMapper;

    @Override
    public void addBatch(List<KuaiShouDimensionMaterial> dimensionMaterials) {
        dimensionMaterialMapper.addBatch(dimensionMaterials);
    }

    @Override
    public PageInfo<List<JSONObject>> getVideoList(Map<String, Object> requestMap, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo, pageSize);

        PageInfo pageInfo = new PageInfo(dimensionMaterialMapper.getVideoList(requestMap));
        return pageInfo;

    }

    @Override
    public String getSignatureByPhotoId(Long photoId) {
        return dimensionMaterialMapper.getSignatureByPhotoId(photoId);
    }
}
