// Path: spring-boot-oauth-resource-server/src/main/java/com/sdcuike/practice/config/feign/OAuth2FeignAutoConfiguration.java
// @Configuration
// public class OAuth2FeignAutoConfiguration {
//     
//     @Bean
//     public RequestInterceptor oauth2FeignRequestInterceptor(@Qualifier("practiceOAuth2RestTemplate") OAuth2RestTemplate oAuth2RestTemplate) {
//         return new OAuth2FeignRequestInterceptor(oAuth2RestTemplate);
//     }
// }


import com.doctor.beaver.domain.result.ModelResult;
import com.sdcuike.practice.config.feign.OAuth2FeignAutoConfiguration;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
package com.sdcuike.practice.feign;


/**
 * Created by beaver on 2017/5/27.<br>
 * <p>
 * {@link https://jmnarloch.wordpress.com/2015/10/14/spring-cloud-feign-oauth2-authentication  }
 */
@FeignClient(name = "exampleService",
        url = "${exampleService.ribbon.listOfServers}",
// Path: spring-boot-oauth-resource-server/src/main/java/com/sdcuike/practice/config/feign/OAuth2FeignAutoConfiguration.java
// @Configuration
// public class OAuth2FeignAutoConfiguration {
//     
//     @Bean
//     public RequestInterceptor oauth2FeignRequestInterceptor(@Qualifier("practiceOAuth2RestTemplate") OAuth2RestTemplate oAuth2RestTemplate) {
//         return new OAuth2FeignRequestInterceptor(oAuth2RestTemplate);
//     }
// }


// Path: spring-boot-oauth-resource-server/src/main/java/com/sdcuike/practice/feign/ExampleServiceFeignClient.java
import com.doctor.beaver.domain.result.ModelResult;
import com.sdcuike.practice.config.feign.OAuth2FeignAutoConfiguration;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

package com.sdcuike.practice.feign;


/**
 * Created by beaver on 2017/5/27.<br>
 * <p>
 * {@link https://jmnarloch.wordpress.com/2015/10/14/spring-cloud-feign-oauth2-authentication  }
 */
@FeignClient(name = "exampleService",
        url = "${exampleService.ribbon.listOfServers}",
        configuration = {OAuth2FeignAutoConfiguration.class})