package org.xyzh.api.crontab;

import org.xyzh.common.core.domain.ResultDomain;
import org.xyzh.common.core.page.PageRequest;
import org.xyzh.common.dto.crontab.TbCrontabEmailRecipient;

import java.util.List;

/**
 * @description 定时任务邮件接收人服务接口
 * @filename EmailRecipientService.java
 * @author yslg
 * @copyright xyzh
 * @since 2025-11-18
 */
public interface EmailRecipientService {

    /**
     * @description 创建邮件接收人
     */
    ResultDomain<TbCrontabEmailRecipient> createRecipient(TbCrontabEmailRecipient recipient);

    /**
     * @description 批量创建邮件接收人
     */
    ResultDomain<Boolean> batchCreateRecipient(List<TbCrontabEmailRecipient> recipients);

    /**
     * @description 更新邮件接收人
     */
    ResultDomain<TbCrontabEmailRecipient> updateRecipient(TbCrontabEmailRecipient recipient);

    /**
     * @description 删除邮件接收人
     */
    ResultDomain<Boolean> deleteRecipient(String recipientId);

    /**
     * @description 根据ID查询
     */
    ResultDomain<TbCrontabEmailRecipient> getRecipientById(String recipientId);

    /**
     * @description 根据任务ID查询接收人列表
     */
    ResultDomain<TbCrontabEmailRecipient> getRecipientsByTaskId(String taskId);

    /**
     * @description 分页查询邮件接收人
     */
    ResultDomain<TbCrontabEmailRecipient> getRecipientPage(PageRequest<TbCrontabEmailRecipient> request);


    /**
     * @description 删除任务的所有接收人
     */
    ResultDomain<Boolean> deleteRecipientsByTaskId(String taskId);
}
