package com.sptg.device.api.feigns;


import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.entity.Device;
import com.sptg.device.api.entity.FlowCardDevice;
import com.sptg.device.api.feigns.fallback.FlowCardDeviceFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "smart-house-device",fallbackFactory = FlowCardDeviceFeignFallbackFactory.class)
public interface FlowCardDeviceFeign {

    /**
     * 功能描述: 获取全部记录
     * @param flowCardDevice 数据传输对象
     * @return
     *
     */
    @PostMapping(value = "/flowCardDevice/getList")
    List<FlowCardDevice> getList(@RequestBody FlowCardDevice flowCardDevice);


    /**
     * 功能描述: 新增绑定
     * @param flowCardDevice 数据传输对象
     * @return
     *
     */
    @PostMapping(value = "/flowCardDevice/add")
    ResultBean<Boolean> add(@RequestBody FlowCardDevice flowCardDevice);

    /**
     * 功能描述: 删除绑定
     * @param flowCardDevice 数据传输对象
     * @return
     *
     */
    @PostMapping(value = "/flowCardDevice/delete")
    ResultBean<Boolean> delete(@RequestBody FlowCardDevice flowCardDevice);

    /**
     * 功能描述: 获取一条记录
     * @param flowCardDevice 数据传输对象
     * @return
     *
     */
    @PostMapping(value = "/flowCardDevice/getOne")
    FlowCardDevice getOne(@RequestBody FlowCardDevice flowCardDevice);

    /**
     * 功能描述: 获取一条记录
     * @param id 数据传输对象
     * @return
     *
     */
    @PostMapping(value = "/flowCardDevice/selectOneById")
    FlowCardDevice selectOneById(@RequestBody Long id);

    /**
     * 功能描述: 获取设备
     * @param flowCardDevice 数据传输对象
     * @return
     *
     */
    @PostMapping(value = "/flowCardDevice/getDeviceByCardId")
    ResultBean<Device> getDeviceByCardId(@RequestBody FlowCardDevice flowCardDevice);
}
