Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
e0b71115
Commit
e0b71115
authored
Jun 24, 2019
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新初始化常量的过程
parent
37a0d572
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/consts/service/SysConfigInit.java
+42
-0
No files found.
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/consts/service/SysConfigInit.java
0 → 100755
View file @
e0b71115
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
consts
.
service
;
import
cn.stylefeng.guns.base.consts.ConstantsContext
;
import
cn.stylefeng.guns.sys.modular.consts.entity.SysConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* <p>
* 参数配置 服务类
* </p>
*
* @author stylefeng
* @since 2019-06-20
*/
@Component
@Slf4j
public
class
SysConfigInit
implements
CommandLineRunner
{
@Autowired
private
SysConfigService
sysConfigService
;
@Override
public
void
run
(
String
...
args
)
{
//初始化所有的常量
List
<
SysConfig
>
list
=
sysConfigService
.
list
();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
SysConfig
sysConfig
:
list
)
{
ConstantsContext
.
putConstant
(
sysConfig
.
getCode
(),
sysConfig
.
getValue
());
}
log
.
info
(
"初始化常量"
+
list
.
size
()
+
"条!"
);
}
}
}
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