package com.yuchen.saas.manage.dict.api.feign;


import com.yuchen.saas.manage.dict.api.entity.Dict;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(
	value = AppNameConstant.SAAS_SYSTEM,
	fallback = IDictClientFallback.class
)
public interface IDictClient {

	String API_PREFIX = "/client";
	String GET_BY_ID = API_PREFIX + "/dict/get-by-id";
	String GET_VALUE = API_PREFIX + "/dict/get-value";
	String GET_LIST = API_PREFIX + "/dict/get-list";

	
	@GetMapping(GET_BY_ID)
	R<Dict> getById(@RequestParam("id") Long id);

	
	@GetMapping(GET_VALUE)
	R<String> getValue(@RequestParam("code") String code, @RequestParam("dictKey") String dictKey);

	
	@GetMapping(GET_LIST)
	R<List<Dict>> getList(@RequestParam("code") String code);

}
