package com.yuchen.saas.device.api.feign;

import com.yuchen.saas.device.api.vo.RunDeviceSceneLinkageRuleVo;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 设备触发接入feign
 * 包含属性、服务、事件收集
 */
@FeignClient(
        value = AppNameConstant.SAAS_DEVICE,
        fallbackFactory = DeviceSceneLinkageRuleClientFallback.class
)
public interface DeviceSceneLinkageRuleClient {

    /**
     * 属性变更规则
     * @param ruleVo 入参
     * @return R 返回
     */
    @PostMapping("/rpc/runRule/property")
    R propertyRunRule(@RequestBody RunDeviceSceneLinkageRuleVo ruleVo);

    /**
     * 事件响应规则
     * @param ruleVo 入参
     * @return R 返回
     */
    @PostMapping("/rpc/runRule/event")
    R eventRunRule(@RequestBody RunDeviceSceneLinkageRuleVo ruleVo);

    /**
     * 设备上下线规则
     * @param ruleVo 入参
     * @return R 返回
     */
    @PostMapping("/rpc/runRule/deviceStatusChange")
    R deviceStatusChangeRunRule(@RequestBody RunDeviceSceneLinkageRuleVo ruleVo);

}
