提交 2e7b5e7a 编写于 作者: 秦晓东

common config

上级 d901aba2
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>springboot-demo</artifactId>
<groupId>com.pannk</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common-config</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
/*
* Copyright (c) 2019, PANNK and/or its affiliates. All rights reserved.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.pannk.demo.commonconfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author:wolf
* @date:2020/10/30 22:59
**/
@SpringBootApplication
public class CommonConfigApplication {
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(CommonConfigApplication.class);
//设置Banner模式为关闭,即不显示Banner内容
// springApplication.setBannerMode(Banner.Mode.OFF);
springApplication.run(args);
// SpringApplication.run(CommonConfigApplication.class, args);
}
}
server:
port: 8888
servlet:
context-path: /
spring:
application:
name: commonConfig
\ No newline at end of file
=================欢迎学习SpringBoot2实战课程================
\ No newline at end of file
......@@ -8,7 +8,6 @@
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>first-application</artifactId>
<dependencies>
......
package com.pannk.demo.firstapplication;
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;
/**
* 第一个SpringBoot程序
* 1、@SpringBootApplication注解标明程序为SpringBootApplication,可以简单理解为规定写法,后面会具体讲解
* 2、此类为系统入口类,应放在项目代码的根目录,即最顶层包,否则会出现不能扫描到包层级高于它的类
*
* @author 老丢丢
*/
@SpringBootApplication
@RestController
public class FirstApplication {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(FirstApplication.class);
application.setBannerMode(Banner.Mode.OFF);
application.run();
SpringApplication.run(FirstApplication.class, args);
}
@GetMapping("/index")
public String index(){
return "Hello,Spring Boot";
}
}
......@@ -5,7 +5,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by wolf on 20-10-28.
*
* @author wolf
* @date 20-10-28
*/
@RestController
@RequestMapping("/hello")
......
......@@ -10,6 +10,7 @@
<description>SpringBoot2课程demo</description>
<modules>
<module>first-application</module>
<module>common-config</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册