package com.xueyi.message.api.transfer.feign;

import com.xueyi.common.core.constant.basic.ServiceConstants;
import com.xueyi.common.core.web.result.AjaxResult;
import com.xueyi.common.core.web.result.R;
import com.xueyi.message.api.transfer.feign.factory.RemoteTransferFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 数据源服务
 *
 * @author xueyi
 */
@FeignClient(contextId = "remoteTransferService", value = ServiceConstants.MESSAGE_SERVICE, fallbackFactory = RemoteTransferFallbackFactory.class)
public interface RemoteTransferService {
    @RequestMapping(value = "/api/device_online_status/{devId}", method = {RequestMethod.GET})
    @ResponseBody
    public AjaxResult getDeviceOnlineStatus(@RequestParam(value = "devId") String devId);

    @RequestMapping(value = "/api/broadcast", method = {RequestMethod.GET})
    @ResponseBody
    public R broadcast(@RequestParam(value = "channel") String channel);


}