package com.yida.data.school.news.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yida.data.common.core.entity.school.EduSchoolMatter;
import com.yida.data.school.vo.index.MatterPageInfoVO;

import org.springframework.scheduling.annotation.Async;

import java.util.List;

/**
 * Service接口
 *
 * @author zhanghaijun
 * @date 2021-07-19 17:21:58
 */
public interface EduSchoolMatterService extends IService<EduSchoolMatter> {
    IPage<MatterPageInfoVO> listMatterPage(Page page, Long schoolId, Integer type, String keyword,
                                           Long groupId);

    void saveMatter(EduSchoolMatter matter);

    @Async
    void saveMatterBatch(List<String> urls, Long schoolId, Integer type);

    void delMatterBatch(List<Long> ids, Long schoolId);

    void batchCluster(Long groupId, Long[] matterIds);

    void batchUnCluster(Long groupId, Long[] matterIds);

    /**
     * 根据url查询素材
     */
    EduSchoolMatter getMatterByUrl(String url, Long schoolId);
}
