package com.moka.gdtauto.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.moka.gdtauto.entity.AdPlan;
import com.moka.gdtauto.entity.AdPlanConf;
import com.moka.gdtauto.entity.AdPlanCreative;

/**
 * 广告计划配置服务接口
 *
 * @author moka
 * @since 2026-02-24
 */
public interface AdPlanConfService extends IService<AdPlanConf> {

    /**
     * 创建广告计划配置
     *
     * @param adPlanConf 广告计划配置
     * @return 配置ID
     */
    Long createAdPlanConf(AdPlanConf adPlanConf);

    /**
     * 更新广告计划配置
     *
     * @param adPlanConf 广告计划配置
     * @return 是否成功
     */
    boolean updateAdPlanConf(AdPlanConf adPlanConf);

    /**
     * 删除广告计划配置
     *
     * @param confId 配置ID
     * @param userId 用户ID
     * @return 是否成功
     */
    boolean deleteAdPlanConf(Long confId, Long userId);

    /**
     * 获取用户的广告计划配置列表（分页）
     *
     * @param userId 用户ID
     * @param pageNum 页码
     * @param pageSize 每页大小
     * @return 配置分页列表
     */
    Page<AdPlanConf> getUserAdPlanConfs(Long userId, Integer pageNum, Integer pageSize, boolean isMy);

    /**
     * 获取广告计划配置详情
     *
     * @param confId 配置ID
     * @param userId 用户ID
     * @return 配置信息
     */
    AdPlanConf getAdPlanConfById(Long confId, Long userId);

    void savePlanAndCreative(List<AdPlan> plans);

    void asyncTencentInterface(AdPlanConf conf, List<AdPlan> plans);
    void asyncReGeneratePlan(Long id);
    void gdtDeleteByConf(AdPlanConf conf);
    void gdtSuspendByConf(AdPlanConf conf);
    void gdtDeleteByPlanIds(AdPlanConf conf, List<Long> planIds);
    void gdtSuspendByPlanIds(AdPlanConf conf, List<Long> planIds);
    void gdtSuspendByPlans(AdPlanConf conf, List<AdPlan> plans);
    void gdtSuspendByCreatives(AdPlanConf conf, List<AdPlanCreative> creatives);


    void gdtAdgroupPatrolDelete(AdPlanConf conf);
}
