package com.yunzhupaas.portal.service;

import com.yunzhupaas.base.service.SuperService;
import com.yunzhupaas.exception.WorkFlowException;
import com.yunzhupaas.portal.entity.PortalDataEntity;
import com.yunzhupaas.portal.model.*;

import java.util.List;

/**
 * 门户数据接口
 *
 * 后期门户模板数据，将会以platform再做区分，
 * 故将formData抽离成单独的表
 * @author
 * @since 2023-04-19
 */
public interface PortalDataService extends SuperService<PortalDataEntity> {

    String getCustomDataForm(PortalCustomPrimary primary) throws Exception;

    String getModelDataForm(PortalModPrimary primary) throws Exception;

    /**
     * 发布
     */
    void release(String platform, String portalId, List<String> systemIdList,String releasePlatform,PortalReleaseForm form) throws Exception;

    void releaseModule(ReleaseModel releaseModel,String portalId) throws Exception;

    Boolean isReleaseFlag(PortalReleasePrimary primary);

    Boolean deleteAll(String portalId);

    /**
     * 创建或更新门户自定义信息
     */
    void createOrUpdate(PortalCustomPrimary primary, String formData) throws Exception;

    /**
     * 创建或更新门户模板信息
     */
    void createOrUpdate(PortalModPrimary primary, String formData) throws Exception;

    /**
     * 创建或更新门户发布信息
     */
    void createOrUpdate(PortalReleasePrimary primary, String formData) throws Exception;

    /**
     * 获取门户显示信息
     *
     * @param portalId 门户ID
     * @param platform 平台：app/pc
     */
    PortalInfoAuthVO getDataFormView(String portalId, String platform) throws Exception;

    /**
     * 设置默认门户
     */
    void setCurrentDefault(String platform, String portalId);

    String getCurrentDefault(String platform) throws Exception;

    /**
     * 获取当前带权限的portalIds
     */
    List<String> getCurrentAuthPortalIds(PortalViewPrimary primary);

}

