package cn.howardliu.gear.spring.boot.autoconfigure;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * <br>created at 17-5-18
 *
 * @author liuxh
 * @version 1.0.0
 * @since 1.0.0
 */
@Configuration
@ConditionalOnProperty(name = "spring.mvc.index.page", havingValue = "status.json")
@AutoConfigureAfter(DispatcherServletAutoConfiguration.class)
public class StatusJsonViewConfigurer extends WebMvcConfigurerAdapter {
    private static final Logger logger = LoggerFactory.getLogger(StatusJsonViewConfigurer.class);

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("redirect:/status.json");
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
        super.addViewControllers(registry);
    }
}

@@ -51,65 +51,8 @@
 e;%0A%0A
-import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 impo
@@ -113,16 +113,16 @@
 eAfter;%0A
+
 import o
@@ -542,23 +542,16 @@
 nfigurer
-Adapter
 ;%0A%0A/**%0A 
@@ -836,14 +836,17 @@
 rer 
-extend
+implement
 s We
@@ -863,116 +863,10 @@
 urer
-Adapter %7B%0A    private static final Logger logger = LoggerFactory.getLogger(StatusJsonViewConfigurer.class);%0A
+ %7B
 %0A   
@@ -1024,16 +1024,16 @@
 json%22);%0A
+
         
@@ -1083,52 +1083,8 @@
 E);%0A
-        super.addViewControllers(registry);%0A
     

use WebMvcConfigurer