Commit d604baada5eb6bc22b8583b310066326b0108a06
1 parent
dfd790dd
分库分表集成例子配置文件调整
Showing
2 changed files
with
11 additions
and
10 deletions
jeecg-boot/jeecg-cloud-module/jeecg-cloud-test/jeecg-cloud-test-shardingsphere/src/main/java/org/jeecg/modules/test/sharding/controller/JeecgShardingDemoController.java
... | ... | @@ -35,7 +35,8 @@ public class JeecgShardingDemoController extends JeecgController<ShardingSysLog, |
35 | 35 | @PostMapping(value = "/test1") |
36 | 36 | @ApiOperation(value = "单库分表插入", notes = "单库分表") |
37 | 37 | public Result<?> add() { |
38 | - int size=10; | |
38 | + log.info("---------------------------------单库分表插入--------------------------------"); | |
39 | + int size = 10; | |
39 | 40 | for (int i = 0; i < size; i++) { |
40 | 41 | ShardingSysLog shardingSysLog = new ShardingSysLog(); |
41 | 42 | shardingSysLog.setLogContent("jeecg"); |
... | ... | @@ -43,7 +44,7 @@ public class JeecgShardingDemoController extends JeecgController<ShardingSysLog, |
43 | 44 | shardingSysLog.setOperateType(i); |
44 | 45 | shardingSysLogService.save(shardingSysLog); |
45 | 46 | } |
46 | - return Result.OK(); | |
47 | + return Result.OK("单库分表插入10条数据完成!"); | |
47 | 48 | } |
48 | 49 | |
49 | 50 | /** |
... | ... | @@ -57,30 +58,30 @@ public class JeecgShardingDemoController extends JeecgController<ShardingSysLog, |
57 | 58 | } |
58 | 59 | |
59 | 60 | /** |
60 | - * 双库分表 - 插入 | |
61 | + * 分库分表 - 插入 | |
61 | 62 | * @return |
62 | 63 | */ |
63 | 64 | @PostMapping(value = "/test2") |
64 | - @ApiOperation(value = "双库分表插入", notes = "双库分表") | |
65 | + @ApiOperation(value = "分库分表插入", notes = "分库分表") | |
65 | 66 | public Result<?> test2() { |
66 | 67 | int start=20; |
67 | - int size=30; | |
68 | + int size=50; | |
68 | 69 | for (int i = start; i <= size; i++) { |
69 | 70 | ShardingSysLog shardingSysLog = new ShardingSysLog(); |
70 | - shardingSysLog.setLogContent("双库分表测试"); | |
71 | - shardingSysLog.setLogType(i); | |
71 | + shardingSysLog.setLogContent("分库分表测试"); | |
72 | + shardingSysLog.setLogType(0); | |
72 | 73 | shardingSysLog.setOperateType(i); |
73 | 74 | shardingSysLogService.save(shardingSysLog); |
74 | 75 | } |
75 | - return Result.OK(); | |
76 | + return Result.OK("分库分表插入10条数据完成!"); | |
76 | 77 | } |
77 | 78 | |
78 | 79 | /** |
79 | - * 双库分表 - 查询 | |
80 | + * 分库分表 - 查询 | |
80 | 81 | * @return |
81 | 82 | */ |
82 | 83 | @PostMapping(value = "/list2") |
83 | - @ApiOperation(value = "双库分表查询", notes = "双库分表") | |
84 | + @ApiOperation(value = "分库分表查询", notes = "分库分表") | |
84 | 85 | public Result<?> list2() { |
85 | 86 | return Result.OK(shardingSysLogService.list()); |
86 | 87 | } |
... | ... |
jeecg-boot/jeecg-cloud-module/jeecg-cloud-test/jeecg-cloud-test-shardingsphere/src/main/resources/application-sharding2.yml renamed to jeecg-boot/jeecg-cloud-module/jeecg-cloud-test/jeecg-cloud-test-shardingsphere/src/main/resources/application-sharding-multi.yml