feat():新增查询库下表接口
parent
54baf0ee15
commit
9514ea221c
|
@ -20,8 +20,6 @@ public class DataRecord {
|
||||||
|
|
||||||
private String ruleVersionType;
|
private String ruleVersionType;
|
||||||
|
|
||||||
private String ruleVersionText;
|
|
||||||
|
|
||||||
private DataValue[] dataValues;
|
private DataValue[] dataValues;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,6 @@ public class DataSet {
|
||||||
|
|
||||||
private String ruleVersionType;
|
private String ruleVersionType;
|
||||||
|
|
||||||
private String ruleVersionText;
|
|
||||||
|
|
||||||
private DataValue[][] dataValue;
|
private DataValue[][] dataValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,6 @@ public class ValueData {
|
||||||
|
|
||||||
private String ruleVersionType;
|
private String ruleVersionType;
|
||||||
|
|
||||||
private String ruleVersionText;
|
|
||||||
|
|
||||||
private DataValue dataValue;
|
private DataValue dataValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,11 @@ public class RuleVersionUpdCodeReq {
|
||||||
@NotNull(message = "规则ID不可为空")
|
@NotNull(message = "规则ID不可为空")
|
||||||
@Schema(title = "版本ID",type = "Long")
|
@Schema(title = "版本ID",type = "Long")
|
||||||
private Long ruleVersionId ;
|
private Long ruleVersionId ;
|
||||||
|
/**
|
||||||
|
* 版本类
|
||||||
|
*/
|
||||||
|
@Schema(title = "版本类名",type = "String")
|
||||||
|
private String ruleVersionType ;
|
||||||
/**
|
/**
|
||||||
* 代码
|
* 代码
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -112,15 +112,6 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<version>3.1.1</version>
|
|
||||||
<configuration>
|
|
||||||
<skip>true</skip>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ public class RuleVersionController {
|
||||||
public Result<String> add(
|
public Result<String> add(
|
||||||
@Validated @RequestBody RuleVersionAddReq ruleVersionAddReq
|
@Validated @RequestBody RuleVersionAddReq ruleVersionAddReq
|
||||||
){
|
){
|
||||||
|
ruleVersionService.uploadOSSJava(ruleVersionAddReq.getRuleVersionType(),ruleVersionAddReq.getRuleVersionText());
|
||||||
ruleVersionService.save(RuleVersion.addBuild(ruleVersionAddReq));
|
ruleVersionService.save(RuleVersion.addBuild(ruleVersionAddReq));
|
||||||
return Result.success(null,"操作成功");
|
return Result.success(null,"操作成功");
|
||||||
}
|
}
|
||||||
|
@ -141,6 +142,7 @@ public class RuleVersionController {
|
||||||
){
|
){
|
||||||
System.out.println(ruleVersionUpdCodeReq);
|
System.out.println(ruleVersionUpdCodeReq);
|
||||||
boolean b = ruleVersionService.updateById(RuleVersion.updCodeBuild(ruleVersionUpdCodeReq, () -> ruleVersionId));
|
boolean b = ruleVersionService.updateById(RuleVersion.updCodeBuild(ruleVersionUpdCodeReq, () -> ruleVersionId));
|
||||||
|
ruleVersionService.uploadOSSJava(ruleVersionUpdCodeReq.getRuleVersionType(),ruleVersionUpdCodeReq.getRuleVersionText());
|
||||||
System.out.println(b);
|
System.out.println(b);
|
||||||
return Result.success(null,"保存成功");
|
return Result.success(null,"保存成功");
|
||||||
}
|
}
|
||||||
|
@ -152,7 +154,7 @@ public class RuleVersionController {
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
@PostMapping("/compileLoad")
|
@PostMapping("/compileLoad")
|
||||||
@Operation(summary = "版本测试",description = "版本测试")
|
@Operation(summary = "字段测试",description = "版本测试")
|
||||||
public Result<String> compileLoad(
|
public Result<String> compileLoad(
|
||||||
@Validated @RequestBody ValueData valueData
|
@Validated @RequestBody ValueData valueData
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
|
|
|
@ -40,4 +40,6 @@ public interface RuleVersionService extends IService<RuleVersion> {
|
||||||
List<DataName> selectDatabase();
|
List<DataName> selectDatabase();
|
||||||
|
|
||||||
List<TableNames> selectTableShow(String dataTableName);
|
List<TableNames> selectTableShow(String dataTableName);
|
||||||
|
|
||||||
|
void uploadOSSJava(String ruleVersionType, String ruleVersionText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,11 +103,6 @@ public class RuleVersionServiceImpl
|
||||||
@Override
|
@Override
|
||||||
public void valueTest(ValueData valueData) {
|
public void valueTest(ValueData valueData) {
|
||||||
|
|
||||||
//上传java文件
|
|
||||||
log.info("上传OSS:java文件");
|
|
||||||
Result<Object> objectResult = ALiYunUpload.uploadJavaFiles(valueData.getRuleVersionText(), valueData.getRuleVersionType());
|
|
||||||
log.info(objectResult.getData());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OSSFileLoad.streamingJavaDownload(valueData.getRuleVersionType());
|
OSSFileLoad.streamingJavaDownload(valueData.getRuleVersionType());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -166,12 +161,15 @@ public class RuleVersionServiceImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void rowTest(DataRecord dataRecord) {
|
public void uploadOSSJava(String ruleVersionType, String ruleVersionText) {
|
||||||
|
|
||||||
//上传java文件
|
//上传java文件
|
||||||
log.info("上传OSS:java文件");
|
log.info("上传OSS:java文件");
|
||||||
Result<Object> objectResult = ALiYunUpload.uploadJavaFiles(dataRecord.getRuleVersionText(), dataRecord.getRuleVersionType());
|
Result<Object> objectResult = ALiYunUpload.uploadJavaFiles(ruleVersionText, ruleVersionType);
|
||||||
log.info(objectResult.getData());
|
log.info(objectResult.getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void rowTest(DataRecord dataRecord) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OSSFileLoad.streamingJavaDownload(dataRecord.getRuleVersionType());
|
OSSFileLoad.streamingJavaDownload(dataRecord.getRuleVersionType());
|
||||||
|
@ -210,32 +208,11 @@ public class RuleVersionServiceImpl
|
||||||
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
|
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
DataValue[] dataValues = new DataValue[3];
|
|
||||||
|
|
||||||
// 初始化每个DataValue对象
|
|
||||||
for (int i = 0; i < dataValues.length; i++) {
|
|
||||||
dataValues[i] = new DataValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
dataValues[0].setKey("id");
|
|
||||||
dataValues[0].setType("bigint");
|
|
||||||
dataValues[0].setLabel("主键ID");
|
|
||||||
dataValues[0].setValue("1");
|
|
||||||
dataValues[1].setKey("name");
|
|
||||||
dataValues[1].setType("string");
|
|
||||||
dataValues[1].setLabel("名字");
|
|
||||||
dataValues[1].setValue(null);
|
|
||||||
dataValues[2].setKey("age");
|
|
||||||
dataValues[2].setType("int");
|
|
||||||
dataValues[2].setLabel("年龄");
|
|
||||||
dataValues[2].setValue("20");
|
|
||||||
System.out.println("l"+dataValues);
|
|
||||||
dataRecord.setDataValues(dataValues);
|
|
||||||
|
|
||||||
System.out.println("测试数据"+dataRecord);
|
System.out.println("测试数据"+dataRecord);
|
||||||
log.info("测试数据:[{}]",dataRecord.getDataValues());
|
log.info("测试数据:[{}]",dataRecord.getDataValues());
|
||||||
|
|
||||||
detection(dataRecord.getRuleVersionType(),dataValues);
|
detection(dataRecord.getRuleVersionType(),dataRecord.getDataValues());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,11 +221,6 @@ public class RuleVersionServiceImpl
|
||||||
@Override
|
@Override
|
||||||
public void setTest(DataSet dataSet) {
|
public void setTest(DataSet dataSet) {
|
||||||
|
|
||||||
//上传java文件
|
|
||||||
log.info("上传OSS:java文件");
|
|
||||||
Result<Object> objectResult = ALiYunUpload.uploadJavaFiles(dataSet.getRuleVersionText(), dataSet.getRuleVersionType());
|
|
||||||
log.info(objectResult.getData());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OSSFileLoad.streamingJavaDownload(dataSet.getRuleVersionType());
|
OSSFileLoad.streamingJavaDownload(dataSet.getRuleVersionType());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue