package com.sptg.device.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.entity.MqConf;
import com.sptg.device.api.feigns.fallback.MqConfFeignFallbackFactory;
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;

/**
 * title: MqConfFeign
 * package: com.sptg.device.api.feigns
 * description: 队列配置-服务接口
 */
@FeignClient(value = "smart-house-device",fallbackFactory = MqConfFeignFallbackFactory.class)
public interface MqConfFeign {

    /**
     * 功能描述: 分页查询队列服务器配置列表
     * @param page 分页条件
     * @return Page<MqConf>
     */
    @PostMapping(value = "/mq/pagingQuery")
    Page<MqConf> pagingQuery(@RequestBody Page<MqConf> page);

    /**
     * 功能描述: 添加队列服务器配置
     * @param conf 配置信息
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/mq/addEntity")
    ResultBean<Boolean> addEntity(@RequestBody MqConf conf);

    /**
     * 功能描述: 根据Id查询队列服务器信息
     * @param id 主键
     * @return MqConf
     */
    @GetMapping(value = "/mq/get/{id}")
    MqConf getMqById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述: 修改队列服务器配置
     * @param conf 服务器配置
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/mq/editEntity")
    ResultBean<Boolean> editEntity(@RequestBody MqConf conf);

    /**
     * 功能描述: 根据Id删除队列服务器
     * @param id 主键
     * @return ResultBean<Boolean>
     */
    @GetMapping(value = "/mq/deleteEntity/{id}")
    ResultBean<Boolean> deleteEntityById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述: 启用队列服务器
     * @param id 主键
     * @return ResultBean<Boolean>
     */
    @GetMapping(value = "/mq/startServer/{id}")
    ResultBean<Boolean> startServer(@PathVariable(value = "id")Long id);

    /**
     * 功能描述:停用队列服务器
     * @param id 主键
     * @return ResultBean<Boolean>
     */
    @GetMapping(value = "/mq/stopServer/{id}")
    ResultBean<Boolean> stopServer(@PathVariable(value = "id")Long id);
}
