Skip to content

Commit 1f85383

Browse files
committed
新增starter
1 parent 10391ea commit 1f85383

File tree

7 files changed

+126
-0
lines changed

7 files changed

+126
-0
lines changed

lambda-query-mongo-starter/pom.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>lambda-query</artifactId>
7+
<groupId>com.github.xuejike</groupId>
8+
<version>1.0.1-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>lambda-query-mongo-starter</artifactId>
13+
14+
<properties>
15+
<maven.compiler.source>8</maven.compiler.source>
16+
<maven.compiler.target>8</maven.compiler.target>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>org.springframework.boot</groupId>
22+
<artifactId>spring-boot-configuration-processor</artifactId>
23+
<optional>true</optional>
24+
<scope>compile</scope>
25+
<version>2.2.11.RELEASE</version>
26+
</dependency>
27+
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter</artifactId>
31+
<version>2.2.11.RELEASE</version>
32+
<scope>compile</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>com.github.xuejike</groupId>
36+
<artifactId>lambda-query-mongo</artifactId>
37+
<version>${query.version}</version>
38+
<scope>compile</scope>
39+
</dependency>
40+
</dependencies>
41+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.xuejike.query.mongo.starter;
2+
3+
import com.github.xuejike.query.mongo.MongoDaoFactory;
4+
import org.springframework.beans.factory.annotation.Autowired;
5+
import org.springframework.context.annotation.Bean;
6+
import org.springframework.context.annotation.Configuration;
7+
import org.springframework.data.mongodb.core.MongoTemplate;
8+
9+
/**
10+
* @author xuejike
11+
* @date 2020/12/31
12+
*/
13+
@Configuration
14+
public class MongoQueryAutoConfig {
15+
@Bean
16+
public MongoDaoFactory mongoDaoFactory(MongoTemplate mongoTemplate){
17+
return new MongoDaoFactory(mongoTemplate);
18+
}
19+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.github.xuejike.query.mongo.starter.MongoQueryAutoConfig
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>lambda-query</artifactId>
7+
<groupId>com.github.xuejike</groupId>
8+
<version>1.0.1-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>lambda-query-mybatis-plus-starter</artifactId>
13+
14+
<properties>
15+
<maven.compiler.source>8</maven.compiler.source>
16+
<maven.compiler.target>8</maven.compiler.target>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>org.springframework.boot</groupId>
22+
<artifactId>spring-boot-configuration-processor</artifactId>
23+
<optional>true</optional>
24+
<scope>compile</scope>
25+
<version>2.2.11.RELEASE</version>
26+
</dependency>
27+
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter</artifactId>
31+
<version>2.2.11.RELEASE</version>
32+
<scope>compile</scope>
33+
</dependency>
34+
<dependency>
35+
<groupId>com.github.xuejike</groupId>
36+
<artifactId>lambda-query-mybatis-plus</artifactId>
37+
<version>${query.version}</version>
38+
<scope>compile</scope>
39+
</dependency>
40+
</dependencies>
41+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.github.xuejike.query.mybatisplus.starter;
2+
3+
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4+
import com.github.xuejike.query.mybatisplus.MyBatisPlusDaoFactory;
5+
import org.springframework.context.annotation.Bean;
6+
import org.springframework.context.annotation.Configuration;
7+
8+
import java.util.Collection;
9+
10+
/**
11+
* @author xuejike
12+
* @date 2020/12/31
13+
*/
14+
@Configuration
15+
public class MybatisPlusAutoConfig {
16+
@Bean
17+
public MyBatisPlusDaoFactory myBatisPlusDaoFactory(Collection<BaseMapper> mapperCollection){
18+
MyBatisPlusDaoFactory myBatisPlusDaoFactory = new MyBatisPlusDaoFactory(mapperCollection);
19+
return myBatisPlusDaoFactory;
20+
}
21+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.github.xuejike.query.mybatisplus.starter.MybatisPlusAutoConfig

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<module>lambda-query-mybatis-plus</module>
1616

1717
<module>mongo-demo</module>
18+
<module>lambda-query-mongo-starter</module>
19+
<module>lambda-query-mybatis-plus-starter</module>
1820
</modules>
1921
<properties>
2022
<maven.compiler.source>1.8</maven.compiler.source>

0 commit comments

Comments
 (0)