|
|
|
package com.net;
|
|
|
|
|
|
|
|
import com.net.filter.CorsFilter;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
|
|
|
import org.springframework.cloud.netflix.feign.EnableFeignClients;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by Administrator on 2017/8/15.
|
|
|
|
*/
|
|
|
|
|
|
|
|
@SpringBootApplication
|
|
|
|
@EnableScheduling
|
|
|
|
@EnableTransactionManagement
|
|
|
|
@EnableFeignClients
|
|
|
|
@EnableAsync
|
|
|
|
@RestController
|
|
|
|
public class WebSocketApplication extends WebMvcConfigurerAdapter {
|
|
|
|
|
|
|
|
private static Logger log = LoggerFactory.getLogger(WebSocketApplication.class);
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
SpringApplication.run(WebSocketApplication.class, args);
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/")
|
|
|
|
@ResponseBody
|
|
|
|
public String weChatLogin(HttpServletRequest request){
|
|
|
|
|
|
|
|
return "hello open";
|
|
|
|
}
|
|
|
|
@Bean
|
|
|
|
public FilterRegistrationBean filterRegist() {
|
|
|
|
FilterRegistrationBean frBean = new FilterRegistrationBean();
|
|
|
|
frBean.setFilter(new CorsFilter());
|
|
|
|
frBean.addUrlPatterns("/*");
|
|
|
|
return frBean;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|