package com.sptg.device.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.dto.DevicePathDto;
import com.sptg.device.api.dto.DeviceRemoteInfoDto;
import com.sptg.device.api.entity.DevicePath;
import com.sptg.device.api.entity.DeviceRemoteInfo;
import com.sptg.device.api.feigns.fallback.DevicePathFeignFallbackFactory;
import com.sptg.device.api.feigns.fallback.DeviceRemoteInfoFeignFallbackFactory;
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;

import java.util.List;

/**
 * title: DeviceRemoteInfo
 * package: com.sptg.device.api.feigns
 * description:: 设备位置-服务接口
 */
@FeignClient(value = "smart-house-device",fallbackFactory = DeviceRemoteInfoFeignFallbackFactory.class)
public interface DeviceRemoteInfoFeign {

    /**
     * 功能描述:分页查询设备远程信息
     *
     * @param dto
     * @return  ResultBean<Page>
     */
    @PostMapping(value = "/deviceRemoteInfo/pagingQuery")
    ResultBean<Page> pagingQuery(@RequestBody DeviceRemoteInfoDto dto);

    /**
     * 功能描述:添加设备远程信息
     * @param dto
     * @return  ResultBean<Boolean>
     */
    @PostMapping(value = "/deviceRemoteInfo/add")
    ResultBean<Boolean> add(@RequestBody DeviceRemoteInfoDto dto);

    /**
     * 功能描述:获取设备远程信息
     * @param dto
     * @return com.sptg.device.api.entity.DevicePath
     */
    @PostMapping(value = "/deviceRemoteInfo/findDeviceRemoteInfo")
    DeviceRemoteInfo findDeviceRemoteInfo(@RequestBody DeviceRemoteInfoDto dto);

    /**
     * 功能描述:获取设备远程信息，根据设备序列号
     * @param serialNumber
     * @return com.sptg.device.api.entity.DevicePath
     */
    @GetMapping(value = "/deviceRemoteInfo/getEntityBySerialNumber/{serialNumber}")
    DeviceRemoteInfo getBySerialNumber(@PathVariable("serialNumber") String serialNumber);

    /**
     * 功能描述: 根据Id获取设备远程信息
     * @param id
     * @return DevicePath
     */
    @GetMapping(value = "/deviceRemoteInfo/getEntityById/{id}")
    DeviceRemoteInfo getById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述:修改设备远程信息
     * @param deviceRemoteInfo
     * @return  ResultBean<Boolean>
     */
    @PostMapping(value = "/deviceRemoteInfo/edit")
    ResultBean<Boolean> edit(@RequestBody DeviceRemoteInfo deviceRemoteInfo);

    /**
     * 功能描述:删除设备远程信息
     * @param dto
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/deviceRemoteInfo/delete")
    ResultBean<Boolean> delete(@RequestBody DeviceRemoteInfoDto dto);

}
