package net.northking.cctp.project.bus.feign;

import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.db.DefaultPagination;
import net.northking.cctp.common.feign.FeignCctpConfig;
import net.northking.cctp.common.http.QueryByPage;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.project.api.pub.dto.PubDto;
import net.northking.cctp.project.dto.software.Software;
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 java.util.List;
import java.util.Map;


@FeignClient(contextId = "platformFeign", value = "cctp-platform", name = "cctp-platform", path = "/cctp-platform", configuration = {FeignCctpConfig.class})
public interface PlatformFeign {
    /**
     * 查询获取字典条目
     *
     * @param catalogCodeList 字典code集合
     * @return 数据列表
     */
    @ApiOperation(value = "获取字典条目")
    @PostMapping(value = "/v1/query/dict-catalog-item",
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultWrapper<Map<String, Object>> getDictByCode(@RequestBody List<String> catalogCodeList);

    /**
     * 外部查询：查询获取字典条目
     *
     * @param pubDto 字典code集合
     * @return 数据列表
     */
    @ApiOperation(value = "获取字典条目")
    @PostMapping(value = "/pub/query/dict-catalog-item",
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
            consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResultWrapper<Map<String, Object>> getPubDictByCode(@RequestBody PubDto pubDto);


}
