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

springboot注解启动leafserver #90

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
move class to support starter
  • Loading branch information
凉之 committed Mar 15, 2020
commit 15394590ae8fe5399198adbad71280c657cf8da5
5 changes: 4 additions & 1 deletion leaf-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@
<artifactId>mybatis-spring</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.sankuai.inf.leaf.service;

import com.alibaba.druid.pool.DruidDataSource;
import com.sankuai.inf.leaf.Constants;
import com.sankuai.inf.leaf.IDGen;
import com.sankuai.inf.leaf.common.PropertyFactory;
import com.sankuai.inf.leaf.common.Result;
import com.sankuai.inf.leaf.common.ZeroIDGen;
import com.sankuai.inf.leaf.exception.InitException;
import com.sankuai.inf.leaf.segment.SegmentIDGenImpl;
import com.sankuai.inf.leaf.segment.dao.IDAllocDao;
import com.sankuai.inf.leaf.segment.dao.impl.IDAllocDaoImpl;
import com.sankuai.inf.leaf.server.Constants;
import com.sankuai.inf.leaf.exception.InitException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
7 changes: 0 additions & 7 deletions leaf-core/src/main/resources/application.properties

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sankuai.inf.leaf.plugin;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

Expand All @@ -10,7 +11,6 @@
@ConfigurationProperties(prefix = "leaf")
@PropertySource("classpath:leaf.properties")
public class LeafSpringBootProperties {

@Value("${segment.enable}")
private boolean enable=false;

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public class LeafSpringBootStarterAutoConfigure {
private LeafSpringBootProperties properties;
@Bean
@ConditionalOnProperty(prefix = "leaf.segment",value = "enable",matchIfMissing = false)
public SegmentService initLeafSegmentStarter(){
return null;
public SegmentService initLeafSegmentStarter() throws Exception{
SegmentService segmentService=new SegmentService();
return segmentService;
}

@Bean
Expand Down