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
d01dddf9
Commit
d01dddf9
authored
Feb 04, 2021
by
kl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态获取演示页访问地址的端口信息
parent
d61e5236
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
ServerMain.java
server/src/main/java/cn/keking/ServerMain.java
+12
-17
ConfigConstants.java
server/src/main/java/cn/keking/config/ConfigConstants.java
+5
-0
No files found.
server/src/main/java/cn/keking/ServerMain.java
View file @
d01dddf9
...
@@ -4,6 +4,7 @@ import org.slf4j.Logger;
...
@@ -4,6 +4,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.util.StopWatch
;
import
org.springframework.util.StopWatch
;
...
@@ -13,23 +14,17 @@ import org.springframework.util.StopWatch;
...
@@ -13,23 +14,17 @@ import org.springframework.util.StopWatch;
@ComponentScan
(
value
=
"cn.keking.*"
)
@ComponentScan
(
value
=
"cn.keking.*"
)
public
class
ServerMain
{
public
class
ServerMain
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServerMain
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServerMain
.
class
);
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
StopWatch
stopWatch
=
new
StopWatch
();
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
stopWatch
.
start
();
ServerMain
.
staticInitSystemProperty
();
ConfigurableApplicationContext
context
=
new
SpringApplicationBuilder
(
ServerMain
.
class
)
new
SpringApplicationBuilder
(
ServerMain
.
class
)
.
logStartupInfo
(
false
)
.
logStartupInfo
(
false
)
.
run
(
args
);
.
run
(
args
);
stopWatch
.
stop
();
stopWatch
.
stop
();
String
port
=
context
.
getEnvironment
().
getProperty
(
"server.port"
);
logger
.
info
(
"kkFileView 服务启动完成,耗时:{}s,演示页请访问: http://127.0.0.1:8012 "
,
stopWatch
.
getTotalTimeSeconds
()
);
logger
.
info
(
"kkFileView 服务启动完成,耗时:{}s,演示页请访问: http://127.0.0.1:{} "
,
stopWatch
.
getTotalTimeSeconds
(),
port
);
}
}
private
static
void
staticInitSystemProperty
(){
//pdfbox兼容低版本jdk
System
.
setProperty
(
"sun.java2d.cmm"
,
"sun.java2d.cmm.kcms.KcmsServiceProvider"
);
}
}
}
server/src/main/java/cn/keking/config/ConfigConstants.java
View file @
d01dddf9
...
@@ -16,6 +16,11 @@ import java.util.Set;
...
@@ -16,6 +16,11 @@ import java.util.Set;
@Component
@Component
public
class
ConfigConstants
{
public
class
ConfigConstants
{
static
{
//pdfbox兼容低版本jdk
System
.
setProperty
(
"sun.java2d.cmm"
,
"sun.java2d.cmm.kcms.KcmsServiceProvider"
);
}
private
static
Boolean
CACHE_ENABLED
;
private
static
Boolean
CACHE_ENABLED
;
private
static
String
[]
SIM_TEXT
=
{};
private
static
String
[]
SIM_TEXT
=
{};
private
static
String
[]
MEDIA
=
{};
private
static
String
[]
MEDIA
=
{};
...
...
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