Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
梁杰芳
slm-fileview
Commits
4f4e7585
Commit
4f4e7585
authored
Feb 08, 2021
by
kl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增 kkFIleView 的 banner 信息
parent
679459f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
ServerMain.java
server/src/main/java/cn/keking/ServerMain.java
+4
-1
AppBanner.java
server/src/main/java/cn/keking/config/AppBanner.java
+28
-0
No files found.
server/src/main/java/cn/keking/ServerMain.java
View file @
4f4e7585
package
cn
.
keking
;
import
cn.keking.config.AppBanner
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.web.ServerProperties
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan
;
...
...
@@ -21,9 +23,10 @@ public class ServerMain {
stopWatch
.
start
();
ConfigurableApplicationContext
context
=
new
SpringApplicationBuilder
(
ServerMain
.
class
)
.
logStartupInfo
(
false
)
.
banner
(
new
AppBanner
())
.
run
(
args
);
stopWatch
.
stop
();
String
port
=
context
.
getEnvironment
().
getProperty
(
"server.port"
);
Integer
port
=
context
.
getBean
(
ServerProperties
.
class
).
getPort
(
);
logger
.
info
(
"kkFileView 服务启动完成,耗时:{}s,演示页请访问: http://127.0.0.1:{} "
,
stopWatch
.
getTotalTimeSeconds
(),
port
);
}
...
...
server/src/main/java/cn/keking/config/AppBanner.java
0 → 100644
View file @
4f4e7585
package
cn
.
keking
.
config
;
import
org.springframework.boot.Banner
;
import
org.springframework.core.env.Environment
;
import
java.io.PrintStream
;
/**
* @author kl (http://kailing.pub)
* @since 2021/2/8
*/
public
class
AppBanner
implements
Banner
{
@Override
public
void
printBanner
(
Environment
environment
,
Class
<?>
sourceClass
,
PrintStream
out
)
{
out
.
println
(
" _ _ ______ _ _ __ __ _ \n"
+
" | | | | | ____| (_) | | \\ \\ / / (_) \n"
+
" | | __ | | __ | |__ _ | | ___ \\ \\ / / _ ___ __ __\n"
+
" | |/ / | |/ / | __| | | | | / _ \\ \\ \\/ / | | / _ \\ \\ \\ /\\ / /\n"
+
" | < | < | | | | | | | __/ \\ / | | | __/ \\ V V / \n"
+
" |_|\\_\\ |_|\\_\\ |_| |_| |_| \\___| \\/ |_| \\___| \\_/\\_/ \n"
+
" \n"
+
" => Spring Boot :: (v2.4.2) QQ1 :: 613025121\n"
+
" => kkFileView :: (v3.3.1) QQ2 :: 484680571\n"
+
" => github :: https://github.com/kekingcn/kkFileView\n"
+
" => gitee :: https://gitee.com/kekingcn/file-online-preview\n"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment