package cn.com.ctop.kuaishou.modules.batch.service;

import cn.com.ctop.common.module.entity.CtopOauthToken;
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.vo.Result;

import java.math.BigDecimal;
import java.util.Map;

public interface IBatchService {
    /**
     * 获取 总花费
     *
     * @param accountId
     * @return
     */
    BigDecimal getCost(Long accountId);

    /**
     * 获取总计划预算
     *
     * @param accountId
     * @return
     */
    BigDecimal getBudget(Long accountId);

    /**
     * 获取计划信息
     *
     * @param accountId
     * @param campaignId
     * @return
     */
    KuaiShouCampaign getCampaignInfo(Long accountId, Long campaignId);


    /**
     * 获取项目最高出价
     *
     * @param accountId
     * @return
     */
    BigDecimal getProjectMaxBid(Long accountId);

    /**
     * 校验广告组名称是否重复
     *
     * @param campaignId
     * @param unitName
     * @return
     */
    Boolean checkUnitName(Long campaignId, String unitName);

    /**
     * 批量创建广告组
     *
     * @param requestJson
     * @return
     */
    JSONObject createUnit(JSONObject requestJson, CtopOauthToken oauthToken) throws Exception;


    /**
     * 批量复制修改广告组
     *
     * @param requestJson
     * @return
     */
    JSONObject copyUpdateUnit(JSONObject requestJson, CtopOauthToken oauthToken);

    /**
     * 批量复制广告组
     *
     * @param copyToCampaignId
     * @return
     */
    JSONObject copyUnit(KuaiShouGroup group, Long copyToCampaignId, CtopOauthToken oauthToken, JSONObject otherJson);


    /**
     * 获取广告组信息
     *
     * @param accountId
     * @param unitId
     * @return
     */
    KuaiShouGroup getUnitInfo(Long accountId, Long unitId);

    /**
     * 创建创意
     *
     * @param requestJson
     * @return
     */
    JSONObject createCreative(JSONObject requestJson) throws Exception;

    /**
     * 获取创意信息
     *
     * @param accountId
     * @param creativeId
     * @return
     */
    KuaiShouCreative getCreativeInfo(Long accountId, Long creativeId);

    /**
     * 修改计划信息
     *
     * @param requestJson
     * @return
     */
    JSONObject updateCampaign(JSONObject requestJson) throws Exception;


    /**
     * 修改广告组
     *
     * @param requestJson
     * @return
     */
    JSONObject updateUnit(JSONObject requestJson, CtopOauthToken token) throws Exception;

    /**
     * 修改广告创意
     *
     * @param requestJson
     * @return
     */
    JSONObject updateCreative(JSONObject requestJson, CtopOauthToken token) throws Exception;


    /**
     * 复制创意
     *
     * @param accountId
     * @param unitId
     * @param copyUnitId
     */
    void copyCreative(Long accountId, Long unitId, Long copyUnitId, JSONObject appJson) throws Exception;


    /**
     * 获取联盟白名单
     *
     * @param accountId
     * @param accessToken
     * @return
     */
    JSONObject getWhiteList(Long accountId, String accessToken);

    /**
     * 获取可选的贴纸样式
     *
     * @param accountId
     * @param accessToken
     * @return
     */
    JSONArray getCreativeWordStyles(Long accountId, String accessToken);

    /**
     * 获取创意分类
     *
     * @param accountId
     * @param accessToken
     * @return
     */
    JSONArray getCreativeCategory(Long accountId, String accessToken);


    Map<String, Object> batchCreateCreative(JSONObject requestJson) throws Exception;

    /**
     * 获取创意分类白名单
     *
     * @param accountId
     * @param accessToken
     * @return
     */
    JSONObject getCategoryWhite(Long accountId, String accessToken);

    Result<Object> getPlayableList(Long accountId, String accessToken);
}
