package com.zd.system.api.netty;

import com.zd.common.core.constant.ServiceNameConstants;
import com.zd.common.core.domain.R;
import com.zd.system.api.laboratory.domain.RemoteLabHardware;
import com.zd.system.api.netty.factory.RemoteNettyFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author Administrator
 */
@FeignClient(contextId = "remoteNettyService", value = ServiceNameConstants.NETTY_SERVICE, fallbackFactory = RemoteNettyFallbackFactory.class)
public interface RemoteNettyService {
    /**
     * 断开设备连接
     * @param hardware 设备对象
     * @return 结果
     */
    @ApiOperation("断开设备连接")
    @PostMapping("/frid/disconnect")
    R<Boolean> disconnect(@RequestBody RemoteLabHardware hardware);

    /**
     * 信道启动FRID扫描监控
     * @param hardware 设备对象
     * @return 结果
     */
    @ApiOperation("信道启动FRID扫描监控")
    @PostMapping("/frid/startMonitorChannels")
    R<Boolean> startMonitorChannels(@RequestBody RemoteLabHardware hardware);

    /**
     * 开启设备警报
     * @param hardware 设备参数
     * @return R
     */
    @ApiOperation("开启设备警报")
    @PostMapping("/frid/alarm")
    R<Boolean> alarm(@RequestBody RemoteLabHardware hardware);

}
