package net.northking.cctp.executePlan.feign;

import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.dto.LabelValue;
import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.vo.ResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@Component
@FeignClient(contextId = "apiMonsterDictService", value = "monster-common", path = "/monster-common/api/dic-item")
public interface ApiMonsterDictService {

    /**
     * 根据字典类型编码获取字典条目键值对
     *
     * @param catalogCode 字典类型编码
     * @return 字典条目键值对
     */
    @GetMapping(value = "/findItemsKVByCatalogCode/{catalogCode}/{hasDisabled}")
    ResponseVO<Map<String, String>> findItemsKVByCatalogCode(
            @PathVariable("catalogCode") String catalogCode,
            @PathVariable("hasDisabled") Boolean hasDisabled);

    /**
     * 根据字典类型编码集合获取字典条目键值对
     *
     * @param catalogCodeList 字典类型编码集合
     * @return 字典条目键值对
     */
    @PostMapping(value = "/findItemsKVByCatalogCodeList/{status}")
    ResponseVO<Map<String, List<LabelValue>>> findItemsKVByCatalogCodeList(@PathVariable("status") Integer status,
                                                                           @RequestBody List<String> catalogCodeList);


}
