package com.crm.manager.service;

import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.system.email.template.SysEmailTemplateSearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.system.config.SendUpdateEmailCodeEntity;
import com.crm.rely.backend.core.entity.system.email.template.*;
import com.crm.rely.backend.model.entity.user.info.*;
import com.crm.rely.backend.core.exception.ServiceException;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 邮件发送模版
 *
 * @author houn
 */
public interface SysEmailTemplateService {

    /**
     * 添加邮件模版
     *
     * @param entity
     * @throws ServiceException
     */
    void add(SysEmailTemplateAddEntity entity) throws ServiceException;

    /**
     * 删除邮件模版
     *
     * @param entity
     * @throws ServiceException
     */
    void delete(SysEmailTemplateDeleteEntity entity, UserInfoEntity infoEntity) throws ServiceException;

    /**
     * 修改邮件模版
     *
     * @param entity
     * @throws ServiceException
     */
    void update(SysEmailTemplateUpdateEntity entity, UserInfoEntity infoEntity) throws ServiceException;

    void save(SysEmailTemplateBatchEntity entity, List<SysEmailTemplateBaseEntity> entitys) throws ServiceException;

    /**
     * 查询邮件模版
     *
     * @param entity
     * @return
     * @throws ServiceException
     */
    ResultWithPagerDto<SysEmailTemplateSearchDto> searchPageList(SysEmailTemplateSearchEntity entity) throws ServiceException;

    BaseResultDto<List<SysEmailTemplateSearchDto>> searchList(SysEmailTemplateSearchEntity entity) throws ServiceException;

    BaseResultDto searchList() throws ServiceException;

    /**
     * 单个获取邮件模版信息
     *
     * @param entity
     * @return
     * @throws ServiceException
     */
    SysEmailTemplateSearchDto searchSingle(SingleLongEntity entity) throws ServiceException;

    void sendEmailCode(SendUpdateEmailCodeEntity entity) throws ServiceException;

    void validated(MultipartFile file) throws ServiceException;

    String uploadFile(MultipartFile file) throws Exception;
}
