39 lines
1.4 KiB
Java
39 lines
1.4 KiB
Java
package com.hxkj.admin;
|
|
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
|
|
import org.springframework.boot.web.server.ConfigurableWebServerFactory;
|
|
import org.springframework.boot.web.server.ErrorPage;
|
|
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
|
/**
|
|
* 启动器
|
|
*/
|
|
@Configuration
|
|
@ComponentScan(basePackages = {"com.hxkj"})
|
|
@MapperScan(basePackages = {"com.hxkj.*.mapper"})
|
|
@EnableTransactionManagement
|
|
@SpringBootApplication(exclude = {RedisRepositoriesAutoConfiguration.class})
|
|
public class LikeAdminApplication {
|
|
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(LikeAdminApplication.class, args);
|
|
}
|
|
|
|
@Bean
|
|
public WebServerFactoryCustomizer<ConfigurableWebServerFactory> myWebServerFactoryCustomizer(){
|
|
return factory -> {
|
|
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/index.html");
|
|
factory.addErrorPages(error404Page);
|
|
};
|
|
}
|
|
|
|
}
|