package com.njcn.device.pq.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pq.api.fallback.PqsTerminalLogsClientFallbackFactory;
import com.njcn.device.pq.pojo.po.Node;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Description:
 * @Author: wr
 * @Date: 2024/8/13 10:14
 */
@FeignClient(value = ServerInfo.DEVICE, path = "/node", fallbackFactory = PqsTerminalLogsClientFallbackFactory.class, contextId = "node")
public interface NodeClient {


    /**
     * 获取全部前置机
     * @return
     */
    @GetMapping("/nodeAllList")
    HttpResult<List<Node>> nodeAllList();

    /**
     * 根据id获取前置机
     * @param id
     * @return
     */
    @GetMapping("/getNodeById")
    HttpResult<Node> getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id);
}
