package net.northking.cctp.designer.ws.feign;

import com.alibaba.fastjson2.JSONObject;
import com.hzbank.testteam.autotest.dependencies.authDependency.constants.AuthDependencyConstants;
import com.hzbank.testteam.autotest.dependencies.authDependency.utils.RequestUtil;
import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.constants.BaseDefineDependencyConstants;
import net.northking.cctp.common.feign.FeignCctpConfig;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.designer.ws.constants.PcuiDesignerConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

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

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


    @PostMapping(value = "/v1/device/pc/release",
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultWrapper<String> release(@RequestHeader(name = PcuiDesignerConstant.AUTHORIZATION_HEADER)String authorization,@RequestHeader(name = AuthDependencyConstants.REQUEST_HEADER_USER_ID)Long userId, @RequestBody Map<String,String> map);
}
