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.entity.DevicePath;
import com.sptg.device.api.feigns.fallback.DevicePathFeignFallbackFactory;
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: DevicePathFeign
 * package: com.sptg.device.api.feigns
 * description:: 设备位置-服务接口
 */
@FeignClient(value = "smart-house-device",fallbackFactory = DevicePathFeignFallbackFactory.class)
public interface DevicePathFeign {

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

    /**
     * 功能描述:添加设备位置信息
     * @param dto
     * @return  ResultBean<Boolean>
     */
    @PostMapping(value = "/devicePath/addEntity")
    ResultBean<Boolean> addEntity(@RequestBody DevicePathDto dto);

    /**
     * 功能描述:获取设备位置信息
     * @param dto
     * @return com.sptg.device.api.entity.DevicePath
     */
    @PostMapping(value = "/devicePath/getEntityById")
    DevicePath getEntityById(@RequestBody DevicePathDto dto);

    /**
     * 功能描述: 根据Id获取位置信息
     * @param id
     * @return DevicePath
     */
    @GetMapping(value = "/devicePath/getEntityById/{id}")
    DevicePath getEntityById(@PathVariable(value = "id")Long id);

    /**
     * 功能描述:修改设备位置信息
     * @param dto
     * @return  ResultBean<Boolean>
     */
    @PostMapping(value = "/devicePath/editEntity")
    ResultBean<Boolean> editEntity(@RequestBody DevicePathDto dto);

    /**
     * 功能描述:删除设备位置信息
     * @param dto
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/devicePath/deleteEntity")
    ResultBean<Boolean> deleteEntity(@RequestBody DevicePathDto dto);

    /**
     * 功能描述:查询设备位置信息
     * @param dto
     * @return List<DevicePath>
     */
    @PostMapping(value = "/devicePath/getList")
    List<DevicePath> getList(@RequestBody DevicePathDto dto);

    @GetMapping(value = "/devicePath/getByOldId/{oldId}")
    DevicePath getByOldId(@PathVariable(value = "oldId") String oldId);

    @PostMapping(value = "/devicePath/updateBatchById")
    Boolean updateBatchById(@RequestBody List<DevicePath> devicePathList);
}
