feat():集数据
parent
fa7a82c540
commit
e5b603417e
|
@ -17,4 +17,17 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-rule-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-property-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.muyu.remote.feign;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.domain.DataName;
|
||||
import com.muyu.common.domain.TableNames;
|
||||
import com.muyu.remote.feign.impl.SelectFeignFactory;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "cloud-property",fallbackFactory = SelectFeignFactory.class)
|
||||
public interface SelectFeignService {
|
||||
|
||||
/**
|
||||
* 查询表数据下所有表表
|
||||
* @param dataName 数据库名称
|
||||
* @return 反护试图
|
||||
*/
|
||||
@PostMapping("/property/dataLink/findSelectDataShow")
|
||||
public Result<List<DataName>> findSelectDataShow(
|
||||
@RequestParam("dataName") String dataName);
|
||||
|
||||
/**
|
||||
* 查询表数据dashuju表
|
||||
* @param dataTableName 查看表下的所有数据
|
||||
* @return 反护试图
|
||||
*/
|
||||
@PostMapping("/property/dataLink/findSelectTableShow")
|
||||
public Result<List<TableNames>> findSelectTableShow(
|
||||
@RequestParam("dataTableName") String dataTableName);
|
||||
|
||||
/**
|
||||
* 获取数据库名
|
||||
* @return 返回试图
|
||||
*/
|
||||
@PostMapping("/property/dataName/list")
|
||||
@Operation(summary = "获取数据库名",description = "从数据库中抽取数据库名称")
|
||||
public Result<List<DataName>> extractDataName();
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.remote.feign.impl;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.domain.DataName;
|
||||
import com.muyu.common.domain.TableNames;
|
||||
import com.muyu.remote.feign.SelectFeignService;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class SelectFeignFactory implements FallbackFactory<SelectFeignService> {
|
||||
@Override
|
||||
public SelectFeignService create(Throwable cause) {
|
||||
return new SelectFeignService() {
|
||||
@Override
|
||||
public Result<List<DataName>> findSelectDataShow(String dataName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<TableNames>> findSelectTableShow(String dataTableName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<DataName>> extractDataName() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -86,6 +86,16 @@
|
|||
<artifactId>cloud-rule-engine</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-rule-remote</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-property-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package com.muyu.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.domain.DataRecord;
|
||||
import com.muyu.common.domain.DataSet;
|
||||
import com.muyu.common.domain.RuleVersion;
|
||||
import com.muyu.common.domain.ValueData;
|
||||
import com.muyu.common.domain.*;
|
||||
import com.muyu.common.domain.req.RuleVersionAddReq;
|
||||
import com.muyu.common.domain.req.RuleVersionUpdCodeReq;
|
||||
import com.muyu.common.domain.req.RuleVersionUpdReq;
|
||||
|
@ -179,4 +176,10 @@ public class RuleVersionController {
|
|||
return Result.success(null,"测试成功");
|
||||
}
|
||||
|
||||
@PostMapping("/selectDatabase")
|
||||
@Operation(summary = "查询数据库")
|
||||
public Result<List<DataName>> selectDatabase(){
|
||||
return Result.success(ruleVersionService.selectDatabase());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package com.muyu.servier;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.domain.DataRecord;
|
||||
import com.muyu.common.domain.DataSet;
|
||||
import com.muyu.common.domain.RuleVersion;
|
||||
import com.muyu.common.domain.ValueData;
|
||||
import com.muyu.common.domain.*;
|
||||
import com.muyu.common.domain.req.RuleVersionUpdReq;
|
||||
import com.muyu.common.domain.resp.RuleVersionResp;
|
||||
|
||||
|
@ -39,4 +36,6 @@ public interface RuleVersionService extends IService<RuleVersion> {
|
|||
void setTest(DataSet dataSet);
|
||||
|
||||
void valueTest(ValueData valueData);
|
||||
|
||||
List<DataName> selectDatabase();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.muyu.constant.MethodSuffix;
|
|||
import com.muyu.engine.basic.BasicEngine;
|
||||
import com.muyu.load.OSSFileLoad;
|
||||
import com.muyu.mapper.RuleVersionMapper;
|
||||
import com.muyu.remote.feign.SelectFeignService;
|
||||
import com.muyu.servier.RuleDataService;
|
||||
import com.muyu.servier.RuleVersionService;
|
||||
import com.muyu.upload.ALiYunUpload;
|
||||
|
@ -43,6 +44,7 @@ public class RuleVersionServiceImpl
|
|||
|
||||
@Autowired private RuleVersionMapper ruleVersionMapper;
|
||||
@Autowired private RuleDataService ruleDataService;
|
||||
@Autowired private SelectFeignService selectFeignService;
|
||||
|
||||
public static final String ClassPath = "/home/lib/com/muyu/generate/";
|
||||
|
||||
|
@ -146,6 +148,12 @@ public class RuleVersionServiceImpl
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataName> selectDatabase() {
|
||||
Result<List<DataName>> listResult = selectFeignService.extractDataName();
|
||||
return listResult.getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rowTest(DataRecord dataRecord) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue