You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/**
|
|
|
|
* Copyright (c) 2018 人人开源 All rights reserved.
|
|
|
|
*
|
|
|
|
* https://www.renren.io
|
|
|
|
*
|
|
|
|
* 版权所有,侵权必究!
|
|
|
|
*/
|
|
|
|
|
|
|
|
package com.epmet;
|
|
|
|
|
|
|
|
import com.epmet.resolver.LoginUserHandlerMethodArgumentResolver;
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
|
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 网关服务
|
|
|
|
*
|
|
|
|
* @author Mark sunlightcs@gmail.com
|
|
|
|
* @since 1.0.0
|
|
|
|
*/
|
|
|
|
@SpringBootApplication
|
|
|
|
@EnableDiscoveryClient
|
|
|
|
@EnableFeignClients
|
|
|
|
public class GatewayApplication extends WebMvcConfigurationSupport {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
SpringApplication.run(GatewayApplication.class, args);
|
|
|
|
}
|
|
|
|
//添加自定义的拦截器
|
|
|
|
@Override
|
|
|
|
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers){
|
|
|
|
super.addArgumentResolvers(argumentResolvers);
|
|
|
|
argumentResolvers.add(new LoginUserHandlerMethodArgumentResolver());
|
|
|
|
}
|
|
|
|
}
|