package net.northking.cctp.guaca.ws;

import com.alibaba.fastjson2.JSONObject;
import net.northking.cctp.common.feign.FeignCctpConfig;
import net.northking.cctp.common.http.ResultWrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(name = "cctp-device-mgr", path = "/cctp-device-mgr", configuration = {FeignCctpConfig.class})
public interface GuacaProxyFeignClient {

    /**
     * 通过token查询目标机器信息
     * @param token
     * @return
     */
    @GetMapping(value = "/v1/device/info/{token}",
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResultWrapper<JSONObject> getInfosByToken(@RequestHeader(name = "Authorization")String authorization, @PathVariable("token") String token);

}
