package com.sptg.ad.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.ad.api.dto.AdTypeDto;
import com.sptg.ad.api.entity.AdType;
import com.sptg.ad.api.feigns.fallback.AdTypeFeignFallbackFactory;
import com.sptg.common.core.beans.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

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

    /**
     * 查询广告类型列表(分页)
     * @param adTypeDto
     * @return 分页查询结果
     *               
     *                      
     */
    @PostMapping(value = "/showAdTypeList")
    ResultBean<Page<AdType>> showAdTypeList(AdTypeDto adTypeDto);

   /**
    * 功能描述:新增/编辑
    * @param  adType
    * @return
    *               
    *                      
    */
    @PostMapping(value = "/addAdType")
    ResultBean<Boolean> addAdType(AdType adType);
    /**
     * 功能描述:删除
     * @param  ids
     * @return
     *               
     *                      
     */
    @PostMapping(value = "/deleteAdType")
    ResultBean<Boolean> deleteAdType(String ids);
    /**
     * 功能描述:获取所有广告分类
     * @param rootOrgId
     * @return 
     *               
     *                       
     */
    @PostMapping(value = "/getAdTypeList")
    ResultBean<AdType> getAdTypeList(Long rootOrgId);
    /**
     * 功能描述: 校验分类名字是否重复
     * @param  adType
     * @return
     *               
     *                       
     */
    @PostMapping(value = "/checkAdTypeName")
    ResultBean<Boolean> checkAdTypeName(AdType adType);

    /**
     * 功能描述:获取广告分类---从缓存中获取
     * @param id
     * @return
     *               
     *                       
     */
    @PostMapping(value = "/getAdTypeById")
    AdType getAdTypeById(Long id);

    /**
     * 功能描述:获取广告分类数量
     * @param adTypeDto
     * @return Integer
     *                
     *                      
     */
    @PostMapping(value = "/getAdTypeCount")
    Integer getAdTypeCount(@RequestBody AdTypeDto adTypeDto);
}
