|
|
@@ -31,6 +31,8 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -127,7 +129,13 @@ public class DataConnectorService {
|
|
|
return new RepEntity(RepCode.success,dataId);
|
|
|
}
|
|
|
|
|
|
- //查看数据源列表
|
|
|
+ /**
|
|
|
+ * 查看数据源列表
|
|
|
+ * @param token
|
|
|
+ * @param testPage
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Cacheable(value = "dataConnector", key = "#testPage.pageNum")
|
|
|
public RepEntity getListConnector(String token, TestPage testPage){
|
|
|
Map<String, String> resultMap = getTokenData.getTokenData(token);
|
|
|
String id = resultMap.get("id");
|
|
|
@@ -160,6 +168,7 @@ public class DataConnectorService {
|
|
|
/*
|
|
|
查看单个数据源配置
|
|
|
*/
|
|
|
+ @Cacheable(value = "singleDataConnector", key = "#body")
|
|
|
public RepEntity getConnector(int id){
|
|
|
DataConnector dataConnector = dataConnectorMapper.getOneData(id);
|
|
|
if (dataConnector == null){
|
|
|
@@ -185,6 +194,7 @@ public class DataConnectorService {
|
|
|
/*
|
|
|
更新数据源配置
|
|
|
*/
|
|
|
+ @CacheEvict(value = "singleDataConnector", key = "#body.dataId")
|
|
|
public RepEntity updateData(DataConnectorInfo dataConnectorInfo){
|
|
|
|
|
|
if (dataConnectorInfo == null && "".equals(dataConnectorInfo)){
|
|
|
@@ -247,6 +257,7 @@ public class DataConnectorService {
|
|
|
/*
|
|
|
更新数据源分组
|
|
|
*/
|
|
|
+ @CacheEvict(value = "singleDataConnector", key = "#body.id")
|
|
|
public RepEntity updateConfigGroup(GroupUpdateId groupUpdateId){
|
|
|
int id = groupUpdateId.getId();
|
|
|
int groupId = groupUpdateId.getGroupId();
|
|
|
@@ -257,7 +268,7 @@ public class DataConnectorService {
|
|
|
/*
|
|
|
删除数据源
|
|
|
*/
|
|
|
-
|
|
|
+ @CacheEvict(value = "singleDataConnector")
|
|
|
public RepEntity delDataConnector(List<Integer> idList){
|
|
|
Iterator isList = idList.iterator();
|
|
|
// while (isList.hasNext()){
|
|
|
@@ -286,6 +297,7 @@ public class DataConnectorService {
|
|
|
/*
|
|
|
更新数据源分组
|
|
|
*/
|
|
|
+ @CacheEvict(value = "singleDataConnector", key = "#body.id")
|
|
|
public RepEntity updataDataConnectorGroup(GroupInfo groupInfo){
|
|
|
dataConnectorMapper.updataConnectorGroup(groupInfo);
|
|
|
return new RepEntity(RepCode.success);
|
|
|
@@ -294,6 +306,7 @@ public class DataConnectorService {
|
|
|
/*
|
|
|
批量更新数据源分组
|
|
|
*/
|
|
|
+ @CacheEvict(value = "singleDataConnector")
|
|
|
public RepEntity updataConnectorGroups(List<GroupInfo> groupInfoList){
|
|
|
Iterator isList = groupInfoList.iterator();
|
|
|
GroupInfo groupInfo = new GroupInfo();
|
|
|
@@ -308,6 +321,7 @@ public class DataConnectorService {
|
|
|
/*
|
|
|
删除数据源分组
|
|
|
*/
|
|
|
+ @CacheEvict(value = "singleDataConnector")
|
|
|
public RepEntity delDataConnectorGroup(List<Integer> idList){
|
|
|
List<Integer> integerList = idList;
|
|
|
Iterator isList = integerList.iterator();
|