大声道撒旦
This commit is contained in:
parent
7c1dc851fa
commit
d8a466a866
@ -38,8 +38,6 @@ public class EnvironmentDTO extends BaseDTO {
|
|||||||
@Schema(description = "部署方式:K8S-Kubernetes集群部署, DOCKER-Docker容器部署, VM-虚拟机部署")
|
@Schema(description = "部署方式:K8S-Kubernetes集群部署, DOCKER-Docker容器部署, VM-虚拟机部署")
|
||||||
private DeployTypeEnum deployType;
|
private DeployTypeEnum deployType;
|
||||||
|
|
||||||
private JsonNode config;
|
|
||||||
|
|
||||||
@Schema(description = "排序号")
|
@Schema(description = "排序号")
|
||||||
@NotNull(message = "排序号不能为空")
|
@NotNull(message = "排序号不能为空")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|||||||
@ -26,6 +26,8 @@ import java.lang.reflect.Field;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
||||||
|
import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSource;
|
||||||
|
import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSourceParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流节点定义服务实现
|
* 工作流节点定义服务实现
|
||||||
@ -206,6 +208,12 @@ public class WorkflowNodeDefinitionServiceImpl extends BaseServiceImpl<WorkflowN
|
|||||||
property.set("required", nestedSchema.get("required"));
|
property.set("required", nestedSchema.get("required"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理数据源
|
||||||
|
SchemaPropertyDataSource dataSource = annotation.dataSource();
|
||||||
|
if (dataSource != null && !dataSource.type().isEmpty()) {
|
||||||
|
processDataSource(property, dataSource);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,6 +225,48 @@ public class WorkflowNodeDefinitionServiceImpl extends BaseServiceImpl<WorkflowN
|
|||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理SchemaPropertyDataSource注解,生成数据源配置
|
||||||
|
*
|
||||||
|
* @param property 当前属性节点
|
||||||
|
* @param dataSource 数据源注解
|
||||||
|
*/
|
||||||
|
private void processDataSource(ObjectNode property, SchemaPropertyDataSource dataSource) {
|
||||||
|
ObjectNode dataSourceNode = property.putObject("dataSource");
|
||||||
|
|
||||||
|
// 处理基本属性
|
||||||
|
dataSourceNode.put("type", dataSource.type());
|
||||||
|
dataSourceNode.put("url", dataSource.url());
|
||||||
|
dataSourceNode.put("valueField", dataSource.valueField());
|
||||||
|
dataSourceNode.put("labelField", dataSource.labelField());
|
||||||
|
|
||||||
|
// 处理依赖字段
|
||||||
|
String[] dependsOn = dataSource.dependsOn();
|
||||||
|
if (dependsOn != null && dependsOn.length > 0) {
|
||||||
|
ArrayNode dependsOnNode = dataSourceNode.putArray("dependsOn");
|
||||||
|
for (String depend : dependsOn) {
|
||||||
|
dependsOnNode.add(depend);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理请求参数
|
||||||
|
SchemaPropertyDataSourceParam[] params = dataSource.params();
|
||||||
|
if (params != null && params.length > 0) {
|
||||||
|
ObjectNode paramsNode = dataSourceNode.putObject("params");
|
||||||
|
for (SchemaPropertyDataSourceParam param : params) {
|
||||||
|
paramsNode.put(param.name(), param.value());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// // 处理其他可选属性
|
||||||
|
// if (!dataSource.method().isEmpty()) {
|
||||||
|
// dataSourceNode.put("method", dataSource.method());
|
||||||
|
// }
|
||||||
|
// if (!dataSource.searchField().isEmpty()) {
|
||||||
|
// dataSourceNode.put("searchField", dataSource.searchField());
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取类的所有字段,包括父类的字段
|
* 获取类的所有字段,包括父类的字段
|
||||||
*/
|
*/
|
||||||
@ -228,7 +278,7 @@ public class WorkflowNodeDefinitionServiceImpl extends BaseServiceImpl<WorkflowN
|
|||||||
while (currentClass != null && !currentClass.equals(Object.class)) {
|
while (currentClass != null && !currentClass.equals(Object.class)) {
|
||||||
// 添加当前类的字段
|
// 添加当前类的字段
|
||||||
fields.addAll(Arrays.asList(currentClass.getDeclaredFields()));
|
fields.addAll(Arrays.asList(currentClass.getDeclaredFields()));
|
||||||
// 获取<EFBFBD><EFBFBD><EFBFBD>类
|
// 获取父类
|
||||||
currentClass = currentClass.getSuperclass();
|
currentClass = currentClass.getSuperclass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user