package com.yonge.cooleshow.biz.dal.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yonge.cooleshow.biz.dal.dto.search.TeacherStyleSearch;
import com.yonge.cooleshow.biz.dal.vo.TeacherStyleVideoVo;
import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import org.springframework.stereotype.Service;
import com.yonge.cooleshow.biz.dal.entity.TeacherStyleVideo;
import com.yonge.cooleshow.biz.dal.dao.TeacherStyleVideoDao;
import com.yonge.cooleshow.biz.dal.service.TeacherStyleVideoService;

import java.util.List;


@Service
public class TeacherStyleVideoServiceImpl extends ServiceImpl<TeacherStyleVideoDao, TeacherStyleVideo> implements TeacherStyleVideoService {

    @Override
    public List<TeacherStyleVideo> selectListByUserId(Long userId) {
        return baseMapper.selectListByUserId(userId);
    }

    @Override
    public Integer removeByUserIdAndOldIds(Long userId, List<Long> oldIds) {
        return baseMapper.removeByUserIdAndOldIds(userId, oldIds);
    }

    @Override
    public boolean batchAddStyleVideo(List<TeacherStyleVideo> createList) {
        return saveBatch(createList);
    }

    @Override
    public IPage<TeacherStyleVideoVo> stylePage(IPage<TeacherStyleVideoVo> page, TeacherStyleSearch query) {
        return page.setRecords(baseMapper.stylePage(page, query));
    }

    @Override
    public HttpResponseResult<Boolean> addVideoBrowse(Long videoId) {
        Integer num = baseMapper.addVideoBrowse(videoId);
        return HttpResponseResult.succeed(num > 0);
    }
}