package com.hotent.portal.persistence.manager;

import com.hotent.base.manager.BaseManager;
import com.hotent.base.model.CommonResult;
import com.hotent.portal.model.Popup;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Optional;

/**
 * 弹窗管理表 服务类
 *
 * @company 广州宏天软件股份有限公司
 * @author zengst
 * @since 2020-11-27
 */
public interface PopupManager extends BaseManager<Popup> {

    boolean saveWithAuth(Popup popup) throws Exception;

    List<Popup> authList(String userId);

    List<Popup> filterAuth(List<Popup> portalSysPopups,String userId);

    List<Popup> filterData(List<Popup> authList, String userId) throws Exception;

    String exportPopup(List<String> ids)throws Exception;

    void importFile(String uzPath) throws Exception;

    boolean removeWithAuth(Collection<? extends Serializable> idList);

    Popup getByAlias(String alias);

    CommonResult<Integer> validateSql(String sql,String dsAlias) throws Exception;

    CommonResult<String> importPopup(Optional<Boolean> confirmImport, Optional<String> cacheFileId) throws Exception;

    CommonResult<String> importCheck(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception;

    String putImportFileInCache(String fileId, String fileJson);

    String getImportFileFromCache(String fileId);

    void delImportFileFromCache(String fileId);

    }
