10000 revert: 移除 shardingjdbc 相关依赖及设施 · cadecode/uni-boot-cloud@049c203 · GitHub
[go: up one dir, main page]

Skip to content

Commit 049c203

Browse files
committed
revert: 移除 shardingjdbc 相关依赖及设施
1 parent 1aba709 commit 049c203

File tree

5 files changed

+4
-140
lines changed

5 files changed

+4
-140
lines changed

common/plugin/datasource/pom.xml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,16 @@
2727
<groupId>p6spy</groupId>
2828
<artifactId>p6spy</artifactId>
2929
</dependency>
30-
<!--sharding jdbc-->
30+
<!--druid 连接池-->
3131
<dependency>
32-
<groupId>org.apache.shardingsphere</groupId>
33-
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
32+
<groupId>com.alibaba</groupId>
33+
<artifactId>druid-spring-boot-starter</artifactId>
3434
</dependency>
3535
<!--动态数据源-->
3636
<dependency>
3737
<groupId>com.baomidou</groupId>
3838
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
3939
</dependency>
40-
<!--druid 连接池-->
41-
<dependency>
42-
<groupId>com.alibaba</groupId>
43-
<artifactId>druid-spring-boot-starter</artifactId>
44-
</dependency>
4540
</dependencies>
4641

4742
</project>

common/plugin/datasource/src/main/java/com/github/cadecode/uniboot/common/plugin/datasource/config/ShardingJdbcConfig.java

Lines changed: 0 additions & 64 deletions
This file was deleted.

common/plugin/datasource/src/main/java/com/github/cadecode/uniboot/common/plugin/datasource/consts/DsConst.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

common/plugin/datasource/src/main/java/com/github/cadecode/uniboot/common/plugin/datasource/util/ShardingHintUtil.java

Lines changed: 0 additions & 29 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
package com.github.cadecode.uniboot.example.svc.controller;
22

33
import com.baomidou.dynamic.datasource.annotation.DS;
4-
import com.github.cadecode.uniboot.common.plugin.datasource.consts.DsConst;
54
import com.github.cadecode.uniboot.framework.base.annotation.ApiFormat;
6-
import com.github.cadecode.uniboot.framework.base.plugin.bean.po.PlgLog;
7-
import com.github.cadecode.uniboot.framework.base.plugin.service.PlgLogService;
8-
import com.github.pagehelper.PageHelper;
95
import io.swagger.annotations.Api;
106
import io.swagger.annotations.ApiOperation;
117
import lombok.RequiredArgsConstructor;
@@ -17,7 +13,6 @@
1713
import org.springframework.web.bind.annotation.RestController;
1814

1915
import java.sql.SQLException;
20-
import java.util.List;
2116

2217
/**
2318
* dynamic-datasource 测试
@@ -28,7 +23,7 @@
2823
@ApiFormat
2924
@Slf4j
3025
@RequiredArgsConstructor
31-
@Api(tags = "动态数据源测试")
26+
@Api(tags = "dynamic-datasource 测试")
3227
@DependsOn("dataSource")
3328
@RestController
3429
@RequestMapping("demo/ds")
@@ -39,8 +34,6 @@ public class DynamicDsController {
3934
*/
4035
private final AbstractDataSource dataSource;
4136

42-
private final PlgLogService plgLogService;
43-
4437
@DS("master")
4538
@ApiOperation("测试 master 数据源")
4639
@PostMapping("test_master")
@@ -55,23 +48,4 @@ public String testSlave1() throws SQLException {
5548
return dataSource.getConnection().getMetaData().getURL();
5649
}
5750

58-
@DS(DsConst.DS_NAME_SHARDING)
59-
@ApiOperation("测试 sharding 数据源读取")
60-
@PostMapping("test_sharding_read")
61-
public List<PlgLog> testShardingRead() throws SQLException {
62-
return PageHelper.startPage(0, 10)
63-
.<PlgLog>doSelectPageInfo(plgLogService::list).getList();
64-
}
65-
66-
@DS(DsConst.DS_NAME_SHARDING)
67-
@ApiOperation("测试 sharding 数据源写入")
68-
@PostMapping("test_sharding_write")
69-
public boolean testShardingWrite() throws SQLException {
70-
return plgLogService.save(PlgLog.builder()
71-
.logType("测试LOG")
72-
.exceptional(false)
73-
.classMethod("DynamicDsController.testShardingWriteAndRead")
74-
.build());
75-
}
76-
7751
}
0