package com.njcn.csdevice.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.fallback.DeviceMessageClientFallbackFactory;
import com.njcn.csdevice.param.DeviceMessageParam;
import com.njcn.csdevice.param.LineInfoParam;
import com.njcn.user.pojo.po.User;
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;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author xy
 */
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/deviceMessage", fallbackFactory = DeviceMessageClientFallbackFactory.class,contextId = "deviceMessage")
public interface DeviceMessageFeignClient {

    @PostMapping("/getEventUserByDeviceId")
    @ApiOperation("根据设备获取需要推送的用户id")
    HttpResult<List<String>> getEventUserByDeviceId(@RequestParam("devId") String devId, @RequestParam("isAdmin") Boolean isAdmin);

    @PostMapping("/getSendUserByType")
    @ApiOperation("根据事件类型和用户id查询打开推送的用户信息")
    HttpResult<List<User>> getSendUserByType(@RequestBody DeviceMessageParam param);

    @PostMapping("/getLineInfo")
    @ApiOperation("获取监测点信息")
    HttpResult<String> getLineInfo(@RequestBody LineInfoParam param);

}
