package com.sptg.ad.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.ad.api.dto.AdOfflinePushRecordDto;
import com.sptg.ad.api.dto.AdPushTaskDto;
import com.sptg.ad.api.entity.*;
import com.sptg.ad.api.feigns.fallback.AdOfflinePushRecordFeignFallbackFactory;
import com.sptg.ad.api.feigns.fallback.AdPushTaskFeignFallbackFactory;
import com.sptg.common.core.beans.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * title: AdPushTaskFeign
 * package: com.sptg.ad.api.feigns
 * description: 线下广告发布-对外接口类
 *
 *
 *
 */
@FeignClient(value = "smart-house-ad",fallbackFactory = AdOfflinePushRecordFeignFallbackFactory.class)
public interface AdOfflinePushRecordFeign {

    /**
     * 查询线下广告发布记录列表(分页)
     * @param adOfflinePushRecordDto
     * @return 分页查询结果
     *
     *
     */
    @PostMapping(value = "/showAdOfflinePushRecordList")
    ResultBean<Page<AdOfflinePushRecord>> showAdOfflinePushRecordList(AdOfflinePushRecordDto adOfflinePushRecordDto);

    /**
     * 功能描述:新增/编辑
     * @param adOfflinePushRecord
     * @return
     *
     *
     */
    @PostMapping(value = "/addAdOfflinePushRecord")
    ResultBean<Boolean> addAdOfflinePushRecord(AdOfflinePushRecord adOfflinePushRecord);
    /**
     * 功能描述：撤销发布
     * @param  id
     * @return
     *
     *
     */
    @PostMapping(value = "/cancelAdOfflinePushRecord")
    ResultBean<Boolean> cancelAdOfflinePushRecord(Long id);
    /**
     * 功能描述:根据id获取线下广告发布记录
     * @param id
     * @return
     *
     *
     */
    @PostMapping(value = "/findAdOfflinePushRecordById")
    AdOfflinePushRecord findAdOfflinePushRecordById(Long id);

    @PostMapping(value = "/updateAdOfflinePushRecord")
    ResultBean<Boolean> updateAdOfflinePushRecord(AdOfflinePushRecord adOfflinePushRecord);
    @PostMapping(value = "/getAdOfflinePushRecordByProvinceName")
    Integer getAdOfflinePushRecordByProvinceName(@RequestParam("provinceShortName") String provinceShortName,@RequestParam("orgPosition") String orgPosition);
    @PostMapping(value = "/getAdOfflinePushRecordByYearMonth")
    Integer getAdOfflinePushRecordByYearMonth(@RequestParam(name="year",required = false) String year,@RequestParam(name="month",required = false) String month);
}
