/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.feign.client;

import com.crunii.micro.common.dto.Result;
import feign.Request;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <pre>
 *     fallback比较鸡肋，基本用不上
 *     实际可以在具体的业务方法里面实现
 *     fallback = MicroCoreClientFallback.class
 *     需要设置，同时指定超时时间和降级策略等配置
 *     feign.circuitbreaker.enabled=true
 * </pre>
 *
 * @author 田平 create 2018年6月6日下午5:29:05
 */
@FeignClient(name = "core")
public interface MicroCoreClient {

	@GetMapping("/TestController/apiVersion")
	@ResponseBody
	public Result<String> apiVersion();

	@GetMapping(path = "/TestController/testFeignClient")
	@ResponseBody
	public Result<String> testFeignClient();

	/**
	 * 单独针对方法设置超时时间
	 *
	 * @param options
	 * @return
	 */
	@GetMapping(path = "/TestController/testFeignClient")
	@ResponseBody
	public Result<String> testFeignClientCustomTimeout(Request.Options options);

	@GetMapping(path = "/TestController/testBreaker")
	@ResponseBody
	public Result<String> testBreaker();

	@GetMapping(path = "/TestController/testTimeout")
	@ResponseBody
	public Result<String> testTimeout();

}
