forked from edp963/davinci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b541892
commit 9d2d054
Showing
6 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
|
||
<assembly> | ||
<id>dist</id> | ||
<id>dist-beta.4</id> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
|
||
|
||
<assembly> | ||
<id>release</id> | ||
<id>release-beta.4</id> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
server/src/main/java/edp/davinci/runner/CheckConfigRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* << | ||
* Davinci | ||
* == | ||
* Copyright (C) 2016 - 2018 EDP | ||
* == | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* >> | ||
* | ||
*/ | ||
|
||
package edp.davinci.runner; | ||
|
||
import com.alibaba.druid.util.StringUtils; | ||
import edp.core.utils.CustomDataSourceUtils; | ||
import edp.davinci.service.CronJobService; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.ApplicationArguments; | ||
import org.springframework.boot.ApplicationRunner; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.stereotype.Component; | ||
|
||
|
||
@Order(0) | ||
@Component | ||
@Slf4j | ||
public class CheckConfigRunner implements ApplicationRunner { | ||
|
||
@Value("${spring.mail.host:}") | ||
private String mailHost; | ||
|
||
@Value("${spring.mail.port}") | ||
private String mailPort; | ||
|
||
@Value("${spring.mail.username}") | ||
private String mailUserName; | ||
|
||
|
||
@Value("${spring.mail.nickname}") | ||
private String nickName; | ||
|
||
|
||
@Autowired | ||
private ApplicationContext applicationContext; | ||
|
||
|
||
@Override | ||
public void run(ApplicationArguments args) { | ||
if (StringUtils.isEmpty(mailHost)) { | ||
log.error("************** Configuration error: mail host connot be empty! **************"); | ||
SpringApplication.exit(applicationContext); | ||
} | ||
|
||
if (StringUtils.isEmpty(mailPort)) { | ||
log.error("************** Configuration error: mail port connot be empty! **************"); | ||
SpringApplication.exit(applicationContext); | ||
} | ||
|
||
if (StringUtils.isEmpty(mailUserName)) { | ||
log.error("************** Configuration error: mail username connot be empty! **************"); | ||
SpringApplication.exit(applicationContext); | ||
} | ||
|
||
if (StringUtils.isEmpty(mailUserName)) { | ||
log.error("************** Configuration error: mail nickname connot be empty! **************"); | ||
SpringApplication.exit(applicationContext); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters