53 lines
1.3 KiB
Java
53 lines
1.3 KiB
Java
![]() |
|
|||
|
package mjkf.xinke;
|
|||
|
|
|||
|
import lombok.extern.slf4j.Slf4j;
|
|||
|
import org.springframework.boot.Banner;
|
|||
|
import org.springframework.boot.SpringApplication;
|
|||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
|
import org.springframework.web.bind.annotation.GetMapping;
|
|||
|
import org.springframework.web.bind.annotation.RestController;
|
|||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
|||
|
|
|||
|
/**
|
|||
|
* SpringBoot方式启动类
|
|||
|
*
|
|||
|
*
|
|||
|
* @date 2021/12/18 16:57
|
|||
|
*/
|
|||
|
@Slf4j
|
|||
|
@EnableSwagger2WebMvc
|
|||
|
@RestController
|
|||
|
@SpringBootApplication
|
|||
|
public class Application {
|
|||
|
|
|||
|
/* 解决druid 日志报错:discard long time none received connection:xxx */
|
|||
|
static {
|
|||
|
System.setProperty("druid.mysql.usePingMethod","false");
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* 主启动函数
|
|||
|
*
|
|||
|
*
|
|||
|
* @date 2022/7/30 21:42
|
|||
|
*/
|
|||
|
public static void main(String[] args) {
|
|||
|
SpringApplication springApplication = new SpringApplication(Application.class);
|
|||
|
springApplication.setBannerMode(Banner.Mode.OFF);
|
|||
|
springApplication.run(args);
|
|||
|
log.info(">>> {}", Application.class.getSimpleName().toUpperCase() + " STARTING SUCCESS");
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* 首页
|
|||
|
*
|
|||
|
*
|
|||
|
* @date 2022/7/8 14:22
|
|||
|
**/
|
|||
|
@GetMapping("/")
|
|||
|
public String index() {
|
|||
|
return "WELCOME";
|
|||
|
}
|
|||
|
}
|