浏览代码

数据源切换接口

LLL 1 年之前
父节点
当前提交
5e3f0216d3

+ 19 - 6
module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/controller/SwitchDataSourceController.java

@@ -49,7 +49,20 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 public class SwitchDataSourceController extends JeecgController<SwitchDataSource, ISwitchDataSourceService> {
 	@Autowired
 	private ISwitchDataSourceService switchDataSourceService;
-	
+
+	 /**
+	  *  数据源切换
+	  */
+	 @ApiOperation(value="数据源切换")
+	 @GetMapping(value = "/edit1")
+	 public Result<String> edit1(Integer type) {
+		 SwitchDataSource switchDataSource = new SwitchDataSource();
+		 switchDataSource.setId(1);
+		 switchDataSource.setType(type);
+		 switchDataSourceService.updateById(switchDataSource);
+		 return Result.OK("编辑成功!");
+	 }
+
 	/**
 	 * 分页列表查询
 	 *
@@ -71,7 +84,7 @@ public class SwitchDataSourceController extends JeecgController<SwitchDataSource
 		IPage<SwitchDataSource> pageList = switchDataSourceService.page(page, queryWrapper);
 		return Result.OK(pageList);
 	}
-	
+
 	/**
 	 *   添加
 	 *
@@ -86,7 +99,7 @@ public class SwitchDataSourceController extends JeecgController<SwitchDataSource
 		switchDataSourceService.save(switchDataSource);
 		return Result.OK("添加成功!");
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -101,7 +114,7 @@ public class SwitchDataSourceController extends JeecgController<SwitchDataSource
 		switchDataSourceService.updateById(switchDataSource);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -116,7 +129,7 @@ public class SwitchDataSourceController extends JeecgController<SwitchDataSource
 		switchDataSourceService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -131,7 +144,7 @@ public class SwitchDataSourceController extends JeecgController<SwitchDataSource
 		this.switchDataSourceService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *