package com.sptg.statistics.api.feigns;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.statistics.api.dto.StatisticsAdPushDto;
import com.sptg.statistics.api.entity.StatisticsAdPush;
import com.sptg.statistics.api.feigns.fallback.StatisticsAdPushFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * title: StatisticsFeign
 * package: com.sptg.statistics.api.feigns
 * description: 广告发布统计-对外服务接口
 *
 *                
 *                 
 */
@FeignClient(value = "smart-house-statistics",fallbackFactory = StatisticsAdPushFeignFallbackFactory.class)
public interface StatisticsAdPushFeign {

    /**
     * 功能描述:添加广告发布统计信息
     * @param statisticsAdPush 广告发布统计信息
     * @return ResultBean<Boolean>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/statisticsAdPush/addAdPush")
    public abstract ResultBean<Boolean> addAdPush(@RequestBody StatisticsAdPush statisticsAdPush);

    /**
     * 功能描述:添加多个广告发布统计
     * @param statisticsAdPushList  广告发布统计信息集合
     * @return ResultBean<Boolean>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/statisticsAdPush/addAdPushList")
    ResultBean<Boolean> addAdPushList(@RequestBody List<StatisticsAdPush> statisticsAdPushList);

    /**
     * 功能描述:统计广告发布（广告曝光量,累计发布广告条数,当月曝光量,当月发布广告条数）
     * @param statisticsAdPushDto
     * @return ResultBean<Map<String,Object>>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/statisticsAdPush/statisticsAdPushTotal")
    public abstract ResultBean<Map<String,Object>>  statisticsAdPushTotal(StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:当月曝光量,当月发布广告条数
     * @param statisticsAdPushDto
     * @return ResultBean<Map<String,Object>>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/statisticsAdPush/statisticsCurrentMonthAdPushTotal")
    ResultBean<Map<String,Object>>  statisticsCurrentMonthAdPushTotal(@RequestBody  StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:查询某年广告曝光量，广告发布数量统计
     * @param statisticsAdPushDto
     * @return  ResultBean<List<Map<String,Object>>>
     *                
     *                       
     */
    @PostMapping(value = "/statistics/statisticsAdPush/statisticsAdPushAndExposure")
    ResultBean<List<Map<String,Object>>>  statisticsAdPushAndExposure(@RequestBody  StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:统计各个省份广告投放
     * @param statisticsAdPushDto
     * @return List<Map<String,Object>>
     *                
     *                      
     */
    @PostMapping(value = "/statistics/statisticsAdPush/statisticsAdPushAndExposureByArea")
    List<Map<String,Object>>  statisticsAdPushAndExposureByArea(@RequestBody StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:统计广告投放量
     * @param statisticsAdPushDto
     * @return Long
     *                
     *                      
     */
    @PostMapping(value = "/statistics/statisticsAdPush/statisticsAdPushCount")
    Long  statisticsAdPushCount(@RequestBody StatisticsAdPushDto statisticsAdPushDto);

    /**
     * 功能描述:根据位置查询广告投放（这里不是广告数量）
     * @param statisticsAdPushDto
     * {
     *    orgPosition : 位置信息
     * }
     * @return ResultBean<Map<String,Integer>>
     *             
     *                      
     */
    @PostMapping(value = "/statistics/statisticsAdPush/getAdPushAccount")
    ResultBean<Map<String, Long>> getAdPushAccount(@RequestBody StatisticsAdPushDto statisticsAdPushDto);

}
