Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Springbootstarter #175

Open
wants to merge 1 commit into
base: feature/spring-boot-starter
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions leaf-core/src/main/resources/leaf.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
@Component
@ConfigurationProperties(prefix = "leaf",ignoreUnknownFields = true)
@PropertySource("classpath:leaf.properties")
public class LeafSpringBootProperties {
private String name;
private Segment segment;
Expand Down
6 changes: 6 additions & 0 deletions leaf-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
<groupId>com.sankuai.inf.leaf</groupId>
<artifactId>leaf-core</artifactId>
</dependency>

<dependency>
<groupId>com.sankuai.inf.leaf</groupId>
<artifactId>leaf-boot-starter</artifactId>
<version>1.0.1-RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
11 changes: 11 additions & 0 deletions leaf-server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -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
11 changes: 9 additions & 2 deletions leaf-server/src/main/resources/leaf-application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<bean id="SnowflakeService" class="com.sankuai.inf.leaf.service.SnowflakeService"/>
<bean id="SegmentService" class="com.sankuai.inf.leaf.service.SegmentService"/>
<bean id="SnowflakeService" class="com.sankuai.inf.leaf.service.SnowflakeService">
<constructor-arg index="0" value="127.0.0.1"/>
<constructor-arg index="1" value="2181"/>
</bean>
<bean id="SegmentService" class="com.sankuai.inf.leaf.service.SegmentService">
<constructor-arg index="0" value="jdbc:mysql://localhost:3306/leafdb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false&amp;serverTimezone=CTT"/>
<constructor-arg index="1" value="root"/>
<constructor-arg index="2" value="123456"/>
</bean>
</beans>