package com.sptg.ad.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.ad.api.entity.ThresholdConfig;
import com.sptg.common.core.beans.PageBean;
import com.sptg.common.core.beans.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 *            
 *               
 * description:
 */
@FeignClient(value = "smart-house-ad")
public interface ThresholdConfigFeign {


    /**
     * 分页查询阈值配置
     * @param pageBean 分页条件
     * @return Page<ThresholdConfig>
     */
    @PostMapping(value = "/threshold_config/pageingQuery")
    Page<ThresholdConfig> pagingQuery(@RequestBody PageBean<ThresholdConfig,ThresholdConfig> pageBean);

    /**
     * 添加配置
     * @param config 配置
     * @return ResultBean
     */
    @PostMapping(value = "/threshold_config/add")
    ResultBean addConfig(@RequestBody ThresholdConfig config);

    /**
     * 根据Id获取阈值配置
     * @param id Id
     * @return ThresholdConfig
     */
    @GetMapping(value = "/threshold_config/get/{id}")
    ThresholdConfig getById(@PathVariable(value = "id") Long id);

    /**
     * 修改阈值配置
     * @param config 配置
     * @return ResultBean
     */
    @PostMapping(value = "/threshold_config/edit")
    ResultBean editConfig(@RequestBody ThresholdConfig config);

    /**
     * 删除配置
     * @param id Id
     * @return ResultBean
     */
    @GetMapping(value = "/threshold_config/delete/{id}")
    ResultBean deleteConfig(@PathVariable(value = "id") Long id);
}
