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.CsDeviceUserClientFallbackFactory;
import com.njcn.csdevice.pojo.param.UserDevParam;
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
import com.njcn.csdevice.pojo.vo.DevUserVO;
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 = "/deviceUser", fallbackFactory = CsDeviceUserClientFallbackFactory.class,contextId = "deviceUser")
public interface CsDeviceUserFeignClient {

    @PostMapping("/addList")
    HttpResult<Boolean> add(@RequestBody List<CsDeviceUserPO> list);

    @PostMapping("/findUserById")
    HttpResult<List<String>> findUserById(@RequestParam("id") String id);

    @PostMapping("/findDevByUserId")
    HttpResult<List<String>> findDevByUserId(@RequestParam("id") String id);

    @PostMapping("/channelDevByUserId")
    HttpResult<List<String>> channelDevByUserId(@RequestBody UserDevParam param);

    @PostMapping("/queryUserById")
    HttpResult<DevUserVO> queryUserById(@RequestParam("devId") String devId);

    @PostMapping("/getList")
    HttpResult<List<CsDeviceUserPO>> getList(@RequestBody UserDevParam param);

    @PostMapping("/getIdList")
    HttpResult<List<String>> getIdList(@RequestParam("param") String param);
}
