package com.crm.rely.backend.service;

import com.crm.rely.backend.exception.ServiceException;

import java.util.Date;

public interface BlackListService {

    void validate(String content, String type) throws ServiceException;

    void validate(String content, String type, String ip) throws ServiceException;

    boolean checkSeal(String content) throws ServiceException;

    /**
     * 根据黑名单验证
     *
     * @param content 黑名单内容
     * @param now     当前发送时间
     * @throws ServiceException
     */
    void checkFromList(String content, Long now) throws ServiceException;

    /**
     * 移除黑名单
     *
     * @param content 黑名单内容
     * @throws ServiceException
     */
    void removeFromList(String content) throws ServiceException;

    void removeFromList(String content, String type) throws ServiceException;

    /**
     * 添加至黑名单
     *
     * @param content 黑名单内容
     * @param ip      ip
     * @param nowDate
     * @throws ServiceException
     */
    void addToList(String content, String ip, Date nowDate) throws ServiceException;

}
