Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
程序猿小郑
microservices-platform
提交
bd764da8
microservices-platform
项目概览
程序猿小郑
/
microservices-platform
与 Fork 源项目一致
Fork自
zlt2000 / microservices-platform
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
microservices-platform
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bd764da8
编写于
8月 28, 2019
作者:
zlt2000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加自定义banner
上级
828fdfa7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
116 addition
and
0 deletion
+116
-0
pom.xml
pom.xml
+6
-0
zlt-commons/zlt-common-spring-boot-starter/pom.xml
zlt-commons/zlt-common-spring-boot-starter/pom.xml
+5
-0
zlt-commons/zlt-common-spring-boot-starter/src/main/java/com/central/common/config/BannerInitializer.java
...ain/java/com/central/common/config/BannerInitializer.java
+30
-0
zlt-commons/zlt-common-spring-boot-starter/src/main/java/com/central/common/constant/CommonConstant.java
...main/java/com/central/common/constant/CommonConstant.java
+5
-0
zlt-commons/zlt-common-spring-boot-starter/src/main/java/com/central/common/utils/CustomBanner.java
.../src/main/java/com/central/common/utils/CustomBanner.java
+38
-0
zlt-commons/zlt-common-spring-boot-starter/src/main/resources/META-INF/spring.factories
...boot-starter/src/main/resources/META-INF/spring.factories
+2
-0
zlt-commons/zlt-common-spring-boot-starter/src/main/resources/zltmp/logo.txt
...mon-spring-boot-starter/src/main/resources/zltmp/logo.txt
+30
-0
未找到文件。
pom.xml
浏览文件 @
bd764da8
...
...
@@ -41,6 +41,7 @@
<userAgent.version>
1.21
</userAgent.version>
<transmittable.version>
2.11.0
</transmittable.version>
<lettuce.version>
5.1.8.RELEASE
</lettuce.version>
<banner.versio>
1.0.2
</banner.versio>
<platform-bom>
Cairo-SR3
</platform-bom>
<spring-cloud-alibaba-dependencies.version>
2.0.0.RELEASE
</spring-cloud-alibaba-dependencies.version>
<spring-boot-dependencies.version>
2.0.9.RELEASE
</spring-boot-dependencies.version>
...
...
@@ -309,6 +310,11 @@
<artifactId>
lettuce-core
</artifactId>
<version>
${lettuce.version}
</version>
</dependency>
<dependency>
<groupId>
com.nepxion
</groupId>
<artifactId>
banner
</artifactId>
<version>
${banner.versio}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
zlt-commons/zlt-common-spring-boot-starter/pom.xml
浏览文件 @
bd764da8
...
...
@@ -83,5 +83,10 @@
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.nepxion
</groupId>
<artifactId>
banner
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
zlt-commons/zlt-common-spring-boot-starter/src/main/java/com/central/common/config/BannerInitializer.java
0 → 100644
浏览文件 @
bd764da8
package
com.central.common.config
;
import
com.central.common.constant.CommonConstant
;
import
com.central.common.utils.CustomBanner
;
import
com.nepxion.banner.BannerConstant
;
import
com.nepxion.banner.Description
;
import
com.nepxion.banner.LogoBanner
;
import
com.taobao.text.Color
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
/**
* Banner初始化
*
* @author zlt
* @date 2019/8/28
*/
public
class
BannerInitializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
@Override
public
void
initialize
(
ConfigurableApplicationContext
applicationContext
)
{
if
(!(
applicationContext
instanceof
AnnotationConfigApplicationContext
))
{
LogoBanner
logoBanner
=
new
LogoBanner
(
BannerInitializer
.
class
,
"/zltmp/logo.txt"
,
"Welcome to zlt"
,
5
,
6
,
new
Color
[
5
],
true
);
CustomBanner
.
show
(
logoBanner
,
new
Description
(
BannerConstant
.
VERSION
+
":"
,
CommonConstant
.
PROJECT_VERSION
,
0
,
1
)
,
new
Description
(
"Gitee:"
,
"https://gitee.com/zlt2000/microservices-platform"
,
0
,
1
)
,
new
Description
(
"Blog:"
,
"https://blog.csdn.net/zlt2000"
,
0
,
1
)
);
}
}
}
zlt-commons/zlt-common-spring-boot-starter/src/main/java/com/central/common/constant/CommonConstant.java
浏览文件 @
bd764da8
...
...
@@ -7,6 +7,11 @@ package com.central.common.constant;
* @date 2018/10/29
*/
public
interface
CommonConstant
{
/**
* 项目版本号(banner使用)
*/
String
PROJECT_VERSION
=
"2.5.0"
;
/**
* token请求头名称
*/
...
...
zlt-commons/zlt-common-spring-boot-starter/src/main/java/com/central/common/utils/CustomBanner.java
0 → 100644
浏览文件 @
bd764da8
package
com.central.common.utils
;
import
com.nepxion.banner.BannerConstant
;
import
com.nepxion.banner.Description
;
import
com.nepxion.banner.DescriptionBanner
;
import
com.nepxion.banner.LogoBanner
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zlt
* @date 2019/8/28
*/
public
class
CustomBanner
{
public
static
void
show
(
LogoBanner
logoBanner
,
Description
...
descriptionList
)
{
String
bannerShown
=
System
.
getProperty
(
BannerConstant
.
BANNER_SHOWN
,
"true"
);
if
(!
Boolean
.
valueOf
(
bannerShown
))
{
return
;
}
System
.
out
.
println
(
""
);
String
bannerShownAnsiMode
=
System
.
getProperty
(
BannerConstant
.
BANNER_SHOWN_ANSI_MODE
,
"false"
);
if
(
Boolean
.
valueOf
(
bannerShownAnsiMode
))
{
System
.
out
.
println
(
logoBanner
.
getBanner
());
}
else
{
System
.
out
.
println
(
logoBanner
.
getPlainBanner
());
}
List
<
Description
>
descriptions
=
new
ArrayList
<>();
for
(
Description
description
:
descriptionList
)
{
descriptions
.
add
(
description
);
}
DescriptionBanner
descriptionBanner
=
new
DescriptionBanner
();
System
.
out
.
println
(
descriptionBanner
.
getBanner
(
descriptions
));
}
}
zlt-commons/zlt-common-spring-boot-starter/src/main/resources/META-INF/spring.factories
0 → 100644
浏览文件 @
bd764da8
org.springframework.context.ApplicationContextInitializer=\
com.central.common.config.BannerInitializer
\ No newline at end of file
zlt-commons/zlt-common-spring-boot-starter/src/main/resources/zltmp/logo.txt
0 → 100644
浏览文件 @
bd764da8
________
| /
`---/ /
/ /
/ /----.
/________|
__
| |
| |
| |
| `----.
|_______|
.___________.
| |
`---| |----`
| |
| |
|__|
.___ ___.
| \/ |
| \ / |
| |\/| |
| | | |
|__| |__|
.______
| _ \
| |_) |
| ___/
| |
| _|
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录