Unverified Commit 8a90ad7d authored by leo65535's avatar leo65535 Committed by GitHub

[Bug] fix the banner of dlink admin app (#977)

* [Bug] fix the banner of dlink admin app

* remove banners
parent 521b4d6f
...@@ -105,10 +105,6 @@ ...@@ -105,10 +105,6 @@
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.nepxion</groupId>
<artifactId>banner</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
......
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 com.dlink.common.banner;
import com.dlink.constant.CommonConstant;
import com.dlink.utils.CustomBanner;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import com.nepxion.banner.BannerConstant;
import com.nepxion.banner.Description;
import com.nepxion.banner.LogoBanner;
import com.taobao.text.Color;
/**
* BannerInitializer
*
* @author wenmo
* @since 2021/5/10 21:40
*/
public class BannerInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
if (!(applicationContext instanceof AnnotationConfigApplicationContext)) {
LogoBanner logoBanner = new LogoBanner(BannerInitializer.class, "/dlink/logo.txt", "Welcome to Dinky", 5, 7, new Color[5], true);
CustomBanner.show(logoBanner, new Description(BannerConstant.VERSION + ":", CommonConstant.PROJECT_VERSION, 0, 1)
, new Description("Github:", "https://github.com/DataLinkDC/dlink", 0, 1)
, new Description("公众号:", "DataLink数据中台", 0, 1)
);
}
}
}
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 com.dlink.utils;
import java.util.ArrayList;
import java.util.List;
import com.nepxion.banner.BannerConstant;
import com.nepxion.banner.Description;
import com.nepxion.banner.DescriptionBanner;
import com.nepxion.banner.LogoBanner;
/**
* CustomBanner
*
* @author wenmo
* @since 2021/5/10 21:45
*/
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));
}
}
org.springframework.context.ApplicationContextInitializer=\
com.dlink.common.banner.BannerInitializer
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.dlink.db.config.MybatisPlusConfigure com.dlink.db.config.MybatisPlusConfigure
\ No newline at end of file
:: Spring Boot :: ${spring-boot.formatted-version}
______ _ __ ______ _ __
|_ _ `. (_) [ | _ |_ _ `. (_) [ | _
| | `. \ __ _ .--. | | / ] _ __ | | `. \ __ _ .--. | | / ] _ __
...@@ -5,3 +7,8 @@ ...@@ -5,3 +7,8 @@
_| |_.' / | | | | | | | |`\ \ \ '/ / _| |_.' / | | | | | | | |`\ \ \ '/ /
|______.' [___][___||__][__| \_][\_: / |______.' [___][___||__][__| \_][\_: /
\__.' \__.'
Version: 0.6.7-SNAPSHOT
Github: https://github.com/DataLinkDC/dlink
公众号: DataLink数据中台
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
<ojdbc8.version>12.2.0.1</ojdbc8.version> <ojdbc8.version>12.2.0.1</ojdbc8.version>
<clickhouse.version>0.2.6</clickhouse.version> <clickhouse.version>0.2.6</clickhouse.version>
<postgresql.version>42.2.14</postgresql.version> <postgresql.version>42.2.14</postgresql.version>
<banner.version>1.0.2</banner.version>
<hibernate-validator.version>6.2.0.Final</hibernate-validator.version> <hibernate-validator.version>6.2.0.Final</hibernate-validator.version>
<!--<flyway.version>6.4.4</flyway.version>--> <!--<flyway.version>6.4.4</flyway.version>-->
<sa-token.version>1.28.0</sa-token.version> <sa-token.version>1.28.0</sa-token.version>
...@@ -173,11 +172,6 @@ ...@@ -173,11 +172,6 @@
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
<version>${postgresql.version}</version> <version>${postgresql.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.nepxion</groupId>
<artifactId>banner</artifactId>
<version>${banner.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment