package com.cm.plugin.service;

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultList;
import com.cm.plugin.pojo.dtos.SensitiveWordsDTO;
import com.cm.plugin.pojo.vos.SensitiveWordsVO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: ISensitiveWordsService
 * @Description: 敏感词
 * @Author: WenG
 * @Date: 2020-03-13 23:16
 * @Version: 1.0
 **/
public interface ISensitiveWordsService {

    /**
     * 新增敏感词
     *
     * @param sensitiveWordsVO
     * @return
     * @throws Exception
     */
    SuccessResult saveSensitiveWords(SensitiveWordsVO sensitiveWordsVO) throws Exception;

    /**
     * 新增敏感词(APP)
     *
     * @param token
     * @param sensitiveWordsVO
     * @return
     * @throws Exception
     */
    SuccessResult saveSensitiveWordsByToken(String token, SensitiveWordsVO sensitiveWordsVO) throws Exception;

    /**
     * 删除敏感词
     *
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeSensitiveWords(String ids) throws RemoveException;

    /**
     * 删除敏感词(APP)
     *
     * @param token
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeSensitiveWordsByToken(String token, String ids) throws RemoveException;

    /**
     * 修改敏感词
     *
     * @param sensitiveWordsId
     * @param sensitiveWordsVO
     * @return
     * @throws Exception
     */
    SuccessResult updateSensitiveWords(String sensitiveWordsId, SensitiveWordsVO sensitiveWordsVO) throws Exception;

    /**
     * 修改敏感词(APP)
     *
     * @param token
     * @param sensitiveWordsId
     * @param sensitiveWordsVO
     * @return
     * @throws Exception
     */
    SuccessResult updateSensitiveWordsByToken(String token, String sensitiveWordsId, SensitiveWordsVO sensitiveWordsVO) throws Exception;

    /**
     * 敏感词详情(通过ID)
     *
     * @param sensitiveWordsId
     * @return
     * @throws SearchException
     */
    SensitiveWordsDTO getSensitiveWordsById(String sensitiveWordsId) throws SearchException;

    /**
     * 敏感词列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<SensitiveWordsDTO> listSensitiveWords(Map<String, Object> params) throws SearchException;

    /**
     * 敏感词分页列表
     *
     * @param page
     * @return
     * @throws SearchException
     */
    SuccessResultList<List<SensitiveWordsDTO>> listPageSensitiveWords(ListPage page) throws SearchException;


    /**
     * 敏感词列表
     *
     * @return
     * @throws SearchException
     */
    List<String> listSensitiveWordsForString() throws SearchException;

    /**
     * 导入敏感词
     *
     * @param excel
     * @return
     * @throws SearchException, IOException
     */
    SuccessResult saveSensitiveWordsExcel(MultipartFile excel) throws SearchException, IOException;
}
