This commit is contained in:
xiangwb
2017-11-13 17:50:00 +08:00
parent 68413342a9
commit cc808c311b
9 changed files with 25 additions and 31 deletions
@@ -37,7 +37,6 @@ public class DispatcherServletConfig extends WebMvcConfigurerAdapter {
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
logger.info("addInterceptors......");
//拦截器1:登录判断
registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**");
// registry.addInterceptor(new LoginInterceptor())
@@ -19,7 +19,7 @@ public class SchedulingConfig {
@Scheduled(cron = "0 */30 * * * ?") // 每半小时执行一次
public void scheduler() {
logger.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> scheduled ... ");
logger.info("scheduled ==================");
//TODO
}
@@ -1,6 +1,8 @@
package com.xwbing.configuration;
import com.xwbing.util.captcah.CaptchaServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -13,6 +15,8 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
public class ServletConfig {
private final Logger logger = LoggerFactory.getLogger(ServletConfig.class);
@Bean
public CaptchaServlet captchaServlet() {
return new CaptchaServlet();
@@ -20,6 +24,7 @@ public class ServletConfig {
@Bean
public ServletRegistrationBean captchaServletRegistrationBean(CaptchaServlet captchaServlet) {
logger.info("注册验证码servlet ======================= ");
ServletRegistrationBean registration = new ServletRegistrationBean(captchaServlet);
registration.setEnabled(true);
registration.addUrlMappings("/servlet/captchaCode");
@@ -36,7 +36,7 @@ public class SwaggerConfig {
.title("Document RESTful APIs")
.description("API接口文档")
.termsOfServiceUrl("http://localhost:8080/swagger-ui.html")
.contact(new Contact("xiangwb", "http://localhost:8080/swagger-ui.html", "xiangwbs@163.com"))
.contact(new Contact("项伟兵", "https://github.com/xiangwbs/boot-module-demo.git", "xiangwbs@163.com"))
.version("1.0.0")
.build();
}