diff --git a/leaf-core/src/main/resources/leaf.properties b/leaf-core/src/main/resources/leaf.properties deleted file mode 100644 index 7ea7dc70..00000000 --- a/leaf-core/src/main/resources/leaf.properties +++ /dev/null @@ -1,9 +0,0 @@ -leaf.name=com.sankuai.leaf.opensource.test -leaf.segment.enable=false -#leaf.jdbc.url= -#leaf.jdbc.username= -#leaf.jdbc.password= - -leaf.snowflake.enable=false -#leaf.snowflake.address= -#leaf.snowflake.port= diff --git a/leaf-plugin/leaf-boot-starter/src/main/java/com.sankuai.inf.leaf.plugin/LeafSpringBootProperties.java b/leaf-plugin/leaf-boot-starter/src/main/java/com.sankuai.inf.leaf.plugin/LeafSpringBootProperties.java index 205a73b7..8e375172 100644 --- a/leaf-plugin/leaf-boot-starter/src/main/java/com.sankuai.inf.leaf.plugin/LeafSpringBootProperties.java +++ b/leaf-plugin/leaf-boot-starter/src/main/java/com.sankuai.inf.leaf.plugin/LeafSpringBootProperties.java @@ -11,7 +11,6 @@ */ @Component @ConfigurationProperties(prefix = "leaf",ignoreUnknownFields = true) -@PropertySource("classpath:leaf.properties") public class LeafSpringBootProperties { private String name; private Segment segment; diff --git a/leaf-server/pom.xml b/leaf-server/pom.xml index 11d7fe9e..442d246e 100644 --- a/leaf-server/pom.xml +++ b/leaf-server/pom.xml @@ -34,6 +34,12 @@ com.sankuai.inf.leaf leaf-core + + + com.sankuai.inf.leaf + leaf-boot-starter + 1.0.1-RELEASE + com.alibaba druid diff --git a/leaf-server/src/main/java/com/sankuai/inf/leaf/server/LeafServerApplication.java b/leaf-server/src/main/java/com/sankuai/inf/leaf/server/LeafServerApplication.java index 6544ebb7..9e239826 100644 --- a/leaf-server/src/main/java/com/sankuai/inf/leaf/server/LeafServerApplication.java +++ b/leaf-server/src/main/java/com/sankuai/inf/leaf/server/LeafServerApplication.java @@ -1,11 +1,13 @@ package com.sankuai.inf.leaf.server; +import com.sankuai.inf.leaf.plugin.annotation.EnableLeafServer; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ImportResource; @SpringBootApplication -@ImportResource("classpath:leaf-application.xml") +@EnableLeafServer +//@ImportResource("classpath:leaf-application.xml") public class LeafServerApplication { public static void main(String[] args) { diff --git a/leaf-server/src/main/resources/application.properties b/leaf-server/src/main/resources/application.properties new file mode 100644 index 00000000..955e39e2 --- /dev/null +++ b/leaf-server/src/main/resources/application.properties @@ -0,0 +1,11 @@ +server.port=8016 + +leaf.name=com.sankuai.leaf.opensource +leaf.segment.enable=true +leaf.segment.url=jdbc:mysql://localhost:3306/leafdb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=CTT +leaf.segment.username=root +leaf.segment.password=123456 + +leaf.snowflake.enable=true +leaf.snowflake.address=127.0.0.1 +leaf.snowflake.port=2181 \ No newline at end of file diff --git a/leaf-server/src/main/resources/leaf-application.xml b/leaf-server/src/main/resources/leaf-application.xml index 205b2d13..54e86816 100644 --- a/leaf-server/src/main/resources/leaf-application.xml +++ b/leaf-server/src/main/resources/leaf-application.xml @@ -4,6 +4,13 @@ xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> - - + + + + + + + + +