diff --git a/pangu-examples/pangu-examples-empty-springboot-based/src/main/resources/application-dev.properties b/pangu-examples/pangu-examples-empty-springboot-based/src/main/resources/application-dev.properties index 40d2c8b2af8b45633ae48231eaeae61fb4722770..37f373e35684a7394dd8f18355e6e6c563591a60 100644 --- a/pangu-examples/pangu-examples-empty-springboot-based/src/main/resources/application-dev.properties +++ b/pangu-examples/pangu-examples-empty-springboot-based/src/main/resources/application-dev.properties @@ -14,4 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -spring.application.name=pangu-showcases-empty-springboot-based \ No newline at end of file +spring.application.name=pangu-showcases-empty-springboot-based + +logging.level.root=INFO \ No newline at end of file diff --git a/pangu-examples/pangu-examples-empty/.gitignore b/pangu-examples/pangu-examples-empty/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c28c61a9cdd9e7bfeca42b43d3d56831f369f72f --- /dev/null +++ b/pangu-examples/pangu-examples-empty/.gitignore @@ -0,0 +1,26 @@ +/target/ +/bin/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ diff --git a/pangu-examples/pangu-examples-empty/README.md b/pangu-examples/pangu-examples-empty/README.md new file mode 100644 index 0000000000000000000000000000000000000000..184d8aeec7fd40aadb9087687852d60a6b9dea2f --- /dev/null +++ b/pangu-examples/pangu-examples-empty/README.md @@ -0,0 +1,39 @@ +#### :mushroom: 本范例演示功能 + +1.创建一个基于盘古框架的空应用 + +#### :four_leaf_clover: 如何创建&启动一个盘古应用 +- **第一步:安装pom依赖** + ``` xml + + com.gitee.pulanos.pangu + pangu-framework-parent + latest.version.xxx + + + ``` + ```xml + + com.gitee.pulanos.pangu + pangu-framework-spring-boot-starter + + ``` +- **第二步:启动类** + + 采用SpringBoot标准启动方式启动。 + + ``` java + @SpringBootApplication + public class EmptyPanguApplication { + public static void main(String[] args) { + PanGuApplicationBuilder.init(EmptyPanguApplication.class).run(args); + } + @Component + public class EmptyService{ + @PostConstruct + public void print(){ + log.info("这是一个基于盘古开发框架的空应用..."); + } + } + } + ``` diff --git a/pangu-examples/pangu-examples-empty/pom.xml b/pangu-examples/pangu-examples-empty/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..f10deefde4543f97d84977ea9357df548e75456f --- /dev/null +++ b/pangu-examples/pangu-examples-empty/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + + com.gitee.pulanos.pangu + pangu-framework-parent + 5.0.7 + + + + com.gitee.pulanos.pangu + pangu-examples-empty + jar + 1.0.0 + + + + com.gitee.pulanos.pangu + pangu-framework-spring-boot-starter + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot-maven-plugin.version} + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + + + + + diff --git a/pangu-examples/pangu-examples-empty/src/main/java/com/gitee/pulanos/pangu/showcases/empty/EmptyPanguApplication.java b/pangu-examples/pangu-examples-empty/src/main/java/com/gitee/pulanos/pangu/showcases/empty/EmptyPanguApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..283480832ee9d0f761af36a40eda95d507dc55d7 --- /dev/null +++ b/pangu-examples/pangu-examples-empty/src/main/java/com/gitee/pulanos/pangu/showcases/empty/EmptyPanguApplication.java @@ -0,0 +1,47 @@ +/* + * 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.gitee.pulanos.pangu.showcases.empty; + +import com.gitee.pulanos.pangu.framework.PanGuApplicationBuilder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; + +/** + * @author xiongchun + */ +@Slf4j +@SpringBootApplication +public class EmptyPanguApplication { + + public static void main(String[] args) { + PanGuApplicationBuilder.init(EmptyPanguApplication.class).run(args); + } + + @Component + public class EmptyService{ + @PostConstruct + public void print(){ + log.info("这是一个基于盘古开发框架的空应用..."); + } + } + +} diff --git a/pangu-examples/pangu-examples-empty/src/main/resources/application-dev.properties b/pangu-examples/pangu-examples-empty/src/main/resources/application-dev.properties new file mode 100644 index 0000000000000000000000000000000000000000..cbd44e8466cf349618bf9eadb2c1f0ad2c732bfc --- /dev/null +++ b/pangu-examples/pangu-examples-empty/src/main/resources/application-dev.properties @@ -0,0 +1,20 @@ +# +# 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. +# +spring.application.name=pangu-examples-empty + +logging.level.root=INFO +logging.level.com.gitee.pulanos.pangu=INFO \ No newline at end of file diff --git a/pangu-examples/pangu-examples-empty/src/main/resources/application.properties b/pangu-examples/pangu-examples-empty/src/main/resources/application.properties new file mode 100644 index 0000000000000000000000000000000000000000..3ed9e2dbdf6b3f36208fe92b7236d20f422960e6 --- /dev/null +++ b/pangu-examples/pangu-examples-empty/src/main/resources/application.properties @@ -0,0 +1,17 @@ +# +# 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. +# +spring.profiles.active=${spring.profiles.active:dev} \ No newline at end of file diff --git a/pangu-examples/pom.xml b/pangu-examples/pom.xml index 91cfb1c2587931fed47df3378a0ee1650f3f0a08..948d3a00c91a048b29bffa3151f5e6e16b63a966 100644 --- a/pangu-examples/pom.xml +++ b/pangu-examples/pom.xml @@ -12,6 +12,7 @@ pangu-examples-empty-springboot-based + pangu-examples-empty pangu-examples-config-remote-nacos pangu-examples-webapi pangu-examples-crud diff --git a/pangu-framework-spring-boot-starter/src/main/java/com/gitee/pulanos/pangu/framework/Constants.java b/pangu-framework-spring-boot-starter/src/main/java/com/gitee/pulanos/pangu/framework/Constants.java index a44121269622b8fbab20fc0f60bf48063a3175ef..512d4d644200181eb04971cd09ce67981897c139 100644 --- a/pangu-framework-spring-boot-starter/src/main/java/com/gitee/pulanos/pangu/framework/Constants.java +++ b/pangu-framework-spring-boot-starter/src/main/java/com/gitee/pulanos/pangu/framework/Constants.java @@ -75,7 +75,7 @@ public final class Constants { /** * 应用启动成功 */ - public final static String APP_START_SUCCESS = "(ô‿ô) PanGu Dev Framework Started successfully ㊥ 盘古开发框架启动成功\\0"; + public final static String APP_START_SUCCESS = "(ô‿ô) PanGu Dev Framework Started successfully ㊥ 盘古开发框架启动成功"; /** * 应用退出 */