Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老丢丢
SpringBoot2Demo
提交
2e7b5e7a
S
SpringBoot2Demo
项目概览
老丢丢
/
SpringBoot2Demo
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SpringBoot2Demo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2e7b5e7a
编写于
10月 30, 2020
作者:
秦
秦晓东
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
common config
上级
d901aba2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
79 addition
and
13 deletion
+79
-13
common-config/pom.xml
common-config/pom.xml
+20
-0
common-config/src/main/java/com/pannk/demo/commonconfig/CommonConfigApplication.java
.../com/pannk/demo/commonconfig/CommonConfigApplication.java
+43
-0
common-config/src/main/resources/application.yml
common-config/src/main/resources/application.yml
+7
-0
common-config/src/main/resources/banner.txt
common-config/src/main/resources/banner.txt
+1
-0
first-application/pom.xml
first-application/pom.xml
+0
-1
first-application/src/main/java/com/pannk/demo/firstapplication/FirstApplication.java
...ava/com/pannk/demo/firstapplication/FirstApplication.java
+4
-11
first-application/src/main/java/com/pannk/demo/firstapplication/HelloController.java
...java/com/pannk/demo/firstapplication/HelloController.java
+3
-1
pom.xml
pom.xml
+1
-0
未找到文件。
common-config/pom.xml
0 → 100644
浏览文件 @
2e7b5e7a
<?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
common-config/src/main/java/com/pannk/demo/commonconfig/CommonConfigApplication.java
0 → 100644
浏览文件 @
2e7b5e7a
/*
* 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);
}
}
common-config/src/main/resources/application.yml
0 → 100644
浏览文件 @
2e7b5e7a
server
:
port
:
8888
servlet
:
context-path
:
/
spring
:
application
:
name
:
commonConfig
\ No newline at end of file
common-config/src/main/resources/banner.txt
0 → 100644
浏览文件 @
2e7b5e7a
=================欢迎学习SpringBoot2实战课程================
\ No newline at end of file
first-application/pom.xml
浏览文件 @
2e7b5e7a
...
...
@@ -8,7 +8,6 @@
<version>
1.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
first-application
</artifactId>
<dependencies>
...
...
first-application/src/main/java/com/pannk/demo/firstapplication/FirstApplication.java
浏览文件 @
2e7b5e7a
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"
;
}
}
first-application/src/main/java/com/pannk/demo/firstapplication/HelloController.java
浏览文件 @
2e7b5e7a
...
...
@@ -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"
)
...
...
pom.xml
浏览文件 @
2e7b5e7a
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录