package com.tzld.piaoquan.api.service.contentplatform;

import com.tzld.piaoquan.api.model.param.contentplatform.*;
import com.tzld.piaoquan.api.model.po.contentplatform.*;
import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanItemVO;
import com.tzld.piaoquan.api.model.vo.contentplatform.QwPlanItemVO;
import com.tzld.piaoquan.api.model.vo.contentplatform.XcxPlanItemVO;
import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
import com.tzld.piaoquan.growth.common.utils.page.Page;
import org.springframework.util.StringUtils;

import java.util.List;

public interface ContentPlatformPlanService {

    static String getVideoTitle(ContentPlatformGzhPlanVideo video) {
        if (StringUtils.hasText(video.getCustomTitle())) {
            return video.getCustomTitle();
        }
        return video.getTitle();
    }

    static String getVideoCover(ContentPlatformGzhPlanVideo video) {
        if (StringUtils.hasText(video.getCustomCover())) {
            return video.getCustomCover();
        }
        if (video.getCover().contains("?")) {
            return video.getCover().substring(0, video.getCover().indexOf("?"));
        }
        return video.getCover();
    }

    Page<GzhPlanItemVO> gzhPlanList(GzhPlanListParam param);

    void gzhPlanSave(GzhPlanSaveParam param);

    Page<VideoContentItemVO> getVideoContentList(VideoContentListParam param);

    List<ContentPlatformVideoDataStatAgg> getTypeChannelVideoDataStatAggList(String datastatDt,
                                                                             String type,
                                                                             List<String> channels,
                                                                             List<Long> videoIds);

    Page<VideoContentItemVO> getUploadVideoContentList(VideoContentListParam param);

    List<String> getVideoContentCategoryList(String category);

    List<String> getVideoContentCoverFrameList(VideoContentCoverFrameParam param);

    Page<QwPlanItemVO> qwPlanList(QwPlanListParam param);

    String qwPlanExport(QwPlanListParam param);

    List<QwPlanItemVO> qwPlanSave(QwPlanSaveParam param);

    String getSharePic(String pageUrl);

    String getShareUrlLink(String pageUrl);

    List<ContentPlatformGzhPlan> getGzhPlanListByCooperateAccountId(Long accountId);

    List<ContentPlatformGzhPlan> getGzhPlanListByCreateAccountId(Long createAccountId);

    List<ContentPlatformGzhPlan> getGzhPlanListByCooperateAccountIds(List<Long> accountIds, Integer type);

    List<ContentPlatformGzhPlanVideo> getGzhPlanVideoListByCooperateAccountId(String ghId);

    List<ContentPlatformQwPlan> getQwPlanListByRootSourceIds(List<String> rootSourceIds);

    List<ContentPlatformQwPlanVideo> getQwPlanVideoListByPlanIds(List<Long> planIds);

    List<ContentPlatformQwPlanVideo> getQwPlanVideoList(List<Long> planIds);

    List<ContentPlatformVideo> getVideoContentListByVideoIds(List<Long> videoIds);

    List<ContentPlatformVideoAgg> getVideoContentAggListByVideoIds(List<Long> videoIds);

    List<ContentPlatformGzhPlanVideo> getGzhPlanVideoList(List<Long> planIds);

    void gzhPlanDelete(Long id);

    void qwPlanDelete(Long id);

    void gzhPlanImport(List<String> channels);

    void qwPlanImport(List<String> channels);

    void gzhUpdateStagePublishStatus(Long id, Integer stagePublishStatus);

    String getGzhChannel(String ghId);

    void saveQwPlanVideo(QwPlanSaveVideoParam videoParam, Long planId, Long loginAccountId);

    Boolean gzhPushCheckExistRootSourceId(String rootSourceId);

    Page<VideoContentItemVO> getDemandVideoContentList(VideoContentListParam param);

    Page<VideoContentItemVO> getVectorVideoContentList(VideoContentListParam param);

    Page<XcxPlanItemVO> xcxPlanList(XcxPlanListParam param);

    String xcxPlanExport(XcxPlanListParam param);

    List<XcxPlanItemVO> xcxPlanSave(XcxPlanSaveParam param);

    List<XcxPlanItemVO> xcxPlanMultiLink(XcxPlanMultiLinkParam param);

    void xcxPlanDelete(Long id);

    List<String> getXcxAudiencePackageList();
}
