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

import com.alibaba.fastjson2.JSONArray;
import net.northking.cctp.common.feign.FeignCctpConfig;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

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

    @PostMapping(value = "/v1/select/catalogItems",
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    JSONArray catalogItems(@RequestHeader(name = PcuiDesignerConstant.AUTHORIZATION_HEADER)String authorization, @RequestBody Map<String,String> map);
}
