package org.springblade.third.iotdevice.feign;

import org.springblade.common.constant.ServicesName;
import org.springblade.core.tool.api.R;
import org.springblade.device.entity.IotDevice;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author lidexi
 * @date 2021/5/27 9:47
 */
@FeignClient(value = ServicesName.THIRD_SERVICE,path = "/feign/third/perception")
public interface IPerceptionIotDeviceClient {

	/**
	 * 感知平台鉴权
	 */
	@PostMapping("/auth/{appId}")
	R auth(@PathVariable("appId") String appId);
	/**
	 * 创建设备
	 * @return
	 */
	@PostMapping("/addDevice")
	R createDevice(@RequestBody IotDevice iotDevice);
	/**
	 * 删除设备
	 * @return
	 */
	@PostMapping("/deleteDevice")
	R deleteDevice(@RequestBody IotDevice iotDevice);
	/**
	 * 查询设备
	 * @return
	 */
	@PostMapping("/queryDevice")
	R queryDevice();
	/**
	 * 批量查询设备
	 * @return
	 */
	@PostMapping("/queryDeviceList/{appId}")
	R<List<IotDevice>> queryDeviceList(@PathVariable("appId") String appId, @RequestParam Integer page);
	/**
	 * 批量查询设备
	 * @return
	 */
	@PostMapping("/updateDevice")
	R updateDevice();

	/**
	 * 查询aep列表
	 * @return
	 */
	@PostMapping("/queryAepList/{appId}")
	R queryAepList(@PathVariable("appId") String appId);
}
