package com.css.simulation.resource.server.infra.feign.service;

import api.common.pojo.common.ResponseBodyVO;
import api.common.pojo.param.RedisParameter;
import com.css.simulation.resource.server.infra.feign.config.FeignConfiguration;
import com.css.simulation.resource.server.infra.feign.fallback.RedisServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

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

/**
 * TODO 线上时候将注解替换掉
 */
//@FeignClient(name = "test", url = "http://127.0.0.1:8001",path = "/simulation/resource/common", fallback = RedisServiceFallback.class, configuration = FeignConfiguration.class)
//@FeignClient(name = "test1", url = "http://47.93.217.159", path = "/simulation/resource/common", fallback = RedisServiceFallback.class, configuration = FeignConfiguration.class)
@FeignClient(value = "simulation-resource-common",
        contextId = "redis",
        path = "/simulation/resource/common",
        fallback = RedisServiceFallback.class,
        configuration = FeignConfiguration.class)
public interface RedisService {

    @PostMapping("/redis/setDictLists")
    ResponseBodyVO<String> setDictLists(List<RedisParameter> redisParameter);

    @PostMapping("/redis/setDictMaps")
    ResponseBodyVO<String> setDictMaps(List<RedisParameter> redisParameter);

    @PostMapping("/redis/getDictLists")
    ResponseBodyVO<Map<String,String>> getDictLists(List<String> keyList);

    @PostMapping("/redis/getDictMaps")
    ResponseBodyVO<Map<String,String>> getDictMaps(List<String> keyList);

}
