package com.crm.manager.service;

import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.system.config.SysConfigSearchDto;
import com.crm.rely.backend.core.entity.system.config.*;
import com.crm.rely.backend.core.pojo.table.SysConfigTable;
import com.crm.rely.backend.core.exception.ServiceException;

import java.util.List;

public interface SysConfigService {

    /**
     * 添加配置
     *
     * @param entity
     * @throws ServiceException
     */
    void add(SysConfigAddEntity entity) throws ServiceException;

    /**
     * 修改配置
     *
     * @param entity
     * @throws ServiceException
     */
    void update(SysConfigUpdateEntity entity) throws ServiceException;

    void updates(SysConfigUpdateEntitys entitys) throws ServiceException;

    /**
     * 删除配置
     *
     * @param entity
     * @throws ServiceException
     */
    void delete(SysConfigDeleteEntity entity) throws ServiceException;

    /**
     * 根据条件查询配置
     *
     * @param entity
     * @return
     * @throws ServiceException
     */
    ResultWithPagerDto<SysConfigSearchDto> searchPageList(SysConfigSearchEntity entity) throws ServiceException;

    /**
     * 根据条件 单个获取配置信息
     *
     * @param entity
     * @return
     * @throws ServiceException
     */
    SysConfigSearchDto searchSingle(SysConfigSingleEntity entity) throws ServiceException;

    /**
     * 根据条件 单个获取配置信息
     *
     * @param code
     * @return
     * @throws ServiceException
     */
    SysConfigSearchDto searchSingleByCode(String code) throws ServiceException;

    List<SysConfigSearchDto> searchSingleByCodes(List<String> codes) throws ServiceException;

    List<SysConfigTable> getByCodes(List<String> codes) throws ServiceException;

    SysConfigTable getByCode(String code) throws ServiceException;

    void sendUpdateEmailCode(SendUpdateEmailCodeEntity entity) throws ServiceException;

    void refresh() throws ServiceException;

    void cancel() throws ServiceException;
}
