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

import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupTemplate;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;

import java.util.List;

/**
 * @Description: 创建组模板
 * @Author: jeecg-boot
 * @Date: 2020-12-15
 * @Version: V1.0
 */
public interface IKuaiShouGroupTemplateService extends IService<KuaiShouGroupTemplate> {

    JSONObject submitUnitTask(JSONObject requestJson) throws Exception;

    void createUnit(KuaiShouGroupTemplate template);

    /**
     * 获取api创建数
     *
     * @param accountId
     * @return
     */
    Result<Object> getApiCreateCount(Long accountId, String date);

    /**
     * 通过photoId 获取 url
     *
     * @param photoId
     * @return
     */
    JSONObject getUrlByPhotoId(Long photoId);

    void createCreative(String accessToken, Long unitId, KuaiShouGroupTemplate template);

    JSONObject getUnionJson(Long templateId);

    /**
     * 获取待创建2.0Id列表
     *
     * @return
     */
    List<Long> getIdList();

    /**
     * 商品信息
     *
     * @param accountId
     * @param accessToken
     * @param libraryId
     * @param page
     * @param pageSize
     * @param libraryName
     * @return
     */
    JSONObject productList(Long accountId, String accessToken, Long libraryId, Integer page, Integer pageSize, String libraryName);

    /**
     * 获取商品库配置
     *
     * @param accountId
     * @return
     */
    JSONObject getLibraryConfig(Long accountId);

    void createUnitAgain(KuaiShouGroupTemplate template);

    List<JSONObject> getUrlByPhotoIds(Long accountId, JSONArray photoIds);
}
