All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.itxiaoer.commons.request.RequestConfig Maven / Gradle / Ivy

There is a newer version: 2.3.4
Show newest version
package com.itxiaoer.commons.request;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.util.Collections;

/**
 * @author : liuyk
 */
@Configuration
public class RequestConfig {

    @Bean
    public RestTemplate restTemplate() {
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.setInterceptors(Collections.singletonList(tokenInterceptor()));
        return restTemplate;
    }

    @Bean
    public TokenInterceptor tokenInterceptor() {
        return new TokenInterceptor();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy