package com.sptg.ad.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.ad.api.dto.AdAdsenseDto;
import com.sptg.ad.api.entity.AdAdsense;
import com.sptg.ad.api.feigns.fallback.AdAdsenseFeignFallbackFactory;
import com.sptg.common.core.beans.ResultBean;
import io.protostuff.Request;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * title: AdAdsenseFeign
 * package: com.sptg.ad.api.feigns
 * description: 广告位-对外接口类
 *
 *
 *
 */
@FeignClient(value = "smart-house-ad",fallbackFactory = AdAdsenseFeignFallbackFactory.class)
public interface AdAdsenseFeign {


    /**
     * 查询广告位列表(分页)
     * @param adAdsenseDto
     * @return 分页查询结果
     *
     *
     */
    @PostMapping(value = "/showAdAdsenseList")
    ResultBean<Page<AdAdsense>> showAdAdsenseList(@RequestBody AdAdsenseDto adAdsenseDto);

    /**
     * 功能描述:新增/编辑
     * @param adAdsense
     * @return
     *
     *
     */
    @PostMapping(value = "/addAdAdsense")
    ResultBean<Boolean> addAdAdsense(AdAdsense adAdsense);
    /**
     * 功能描述:删除
     * @param  ids
     * @return
     *
     *
     */
    @PostMapping(value = "/deleteAdAdsense")
    ResultBean<Boolean> deleteAdAdsense(@RequestBody String ids);

    /**
     * 功能描述: 根据id查询广告位
     * @param
     * @return
     *
     *
     */
    @PostMapping(value = "/findAdsenseById")
    AdAdsense findAdsenseById(@RequestBody Long id);

    /**
     * 功能描述:批量删除广告位
     * @param adAdsenseDto{ids:必填}
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/deleteAdsenseList")
    ResultBean<Boolean> deleteAdsenseList(@RequestBody  AdAdsenseDto adAdsenseDto);

    /**
     * 功能描述:修改广告位状态
     * @param id{ids:必填}
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/updateAdsenseStatus")
    ResultBean<Boolean> updateAdsenseStatus(@RequestParam("id") Long id,@RequestParam("adsenseStatus") String adsenseStatus);

    @GetMapping(value="/getAllCount")
    ResultBean<Integer> getAllAdsenseCount();
}

