大声道撒旦
This commit is contained in:
parent
fc88511544
commit
2724410031
@ -20,14 +20,6 @@ import lombok.EqualsAndHashCode;
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class DeployAppConfigDTO extends BaseDTO {
|
public class DeployAppConfigDTO extends BaseDTO {
|
||||||
|
|
||||||
@Schema(description = "环境ID")
|
|
||||||
@NotNull(message = "环境ID不能为空")
|
|
||||||
private Long environmentId;
|
|
||||||
|
|
||||||
@Schema(description = "应用ID")
|
|
||||||
@NotNull(message = "应用ID不能为空")
|
|
||||||
private Long applicationId;
|
|
||||||
|
|
||||||
@Schema(description = "应用")
|
@Schema(description = "应用")
|
||||||
private ApplicationDTO application;
|
private ApplicationDTO application;
|
||||||
|
|
||||||
@ -38,9 +30,6 @@ public class DeployAppConfigDTO extends BaseDTO {
|
|||||||
@NotNull(message = "应用语言不能为空")
|
@NotNull(message = "应用语言不能为空")
|
||||||
private DevelopmentLanguageTypeEnum languageType;
|
private DevelopmentLanguageTypeEnum languageType;
|
||||||
|
|
||||||
@NotNull(message = "已发布的流程定义ID")
|
|
||||||
private Long workflowDefinitionId;
|
|
||||||
|
|
||||||
@Schema(description = "已发布的流程定义")
|
@Schema(description = "已发布的流程定义")
|
||||||
private WorkflowDefinitionDTO publishedWorkflowDefinition;
|
private WorkflowDefinitionDTO publishedWorkflowDefinition;
|
||||||
|
|
||||||
@ -48,6 +37,17 @@ public class DeployAppConfigDTO extends BaseDTO {
|
|||||||
@NotNull(message = "构建配置不能为空")
|
@NotNull(message = "构建配置不能为空")
|
||||||
private JsonNode buildVariables;
|
private JsonNode buildVariables;
|
||||||
|
|
||||||
|
@Schema(description = "环境ID")
|
||||||
|
@NotNull(message = "环境ID不能为空")
|
||||||
|
private Long environmentId;
|
||||||
|
|
||||||
|
@Schema(description = "应用ID")
|
||||||
|
@NotNull(message = "应用ID不能为空")
|
||||||
|
private Long applicationId;
|
||||||
|
|
||||||
|
@NotNull(message = "已发布的流程定义ID")
|
||||||
|
private Long workflowDefinitionId;
|
||||||
|
|
||||||
@NotNull(message = "启用字段不能为空")
|
@NotNull(message = "启用字段不能为空")
|
||||||
private Boolean enabled = true;
|
private Boolean enabled = true;
|
||||||
|
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.dto.variables;
|
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.CodeEditorConfig;
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSource;
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSourceParam;
|
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables.DeployNodeFormVariables;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Jenkins构建变量
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class JenkinsBaseBuildVariables extends DeployNodeFormVariables {
|
|
||||||
|
|
||||||
@SchemaProperty(
|
|
||||||
title = "禅道任务号",
|
|
||||||
description = "禅道任务号",
|
|
||||||
order = 0
|
|
||||||
)
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,14 +1,15 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables;
|
package com.qqchen.deploy.backend.deploy.dto.variables.build;
|
||||||
|
|
||||||
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.SchemaPropertyDataSource;
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSourceParam;
|
import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSourceParam;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建变量
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
public class JenkinsBaseBuildVariables {
|
||||||
public class DeployNodeFormVariables extends BaseNodeFormVariables {
|
|
||||||
|
|
||||||
@SchemaProperty(
|
@SchemaProperty(
|
||||||
title = "绑定三方Jenkins系统",
|
title = "绑定三方Jenkins系统",
|
||||||
@ -20,7 +21,7 @@ public class DeployNodeFormVariables extends BaseNodeFormVariables {
|
|||||||
valueField = "id",
|
valueField = "id",
|
||||||
labelField = "name"
|
labelField = "name"
|
||||||
),
|
),
|
||||||
order = 1
|
order = 2
|
||||||
)
|
)
|
||||||
private String externalSystemId;
|
private String externalSystemId;
|
||||||
|
|
||||||
@ -39,7 +40,7 @@ public class DeployNodeFormVariables extends BaseNodeFormVariables {
|
|||||||
@SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}")
|
@SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}")
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
order = 2
|
order = 3
|
||||||
)
|
)
|
||||||
private String viewId;
|
private String viewId;
|
||||||
|
|
||||||
@ -59,8 +60,8 @@ public class DeployNodeFormVariables extends BaseNodeFormVariables {
|
|||||||
@SchemaPropertyDataSourceParam(name = "viewId", value = "${viewId}")
|
@SchemaPropertyDataSourceParam(name = "viewId", value = "${viewId}")
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
order = 3
|
order = 4
|
||||||
)
|
)
|
||||||
private String jobId;
|
private String jobId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.dto.variables;
|
package com.qqchen.deploy.backend.deploy.dto.variables.build;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.dto.variables;
|
package com.qqchen.deploy.backend.deploy.dto.variables.build;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@ -40,6 +40,10 @@ public class DeployAppConfig extends Entity<Long> {
|
|||||||
@Column(name = "workflow_definition_id", nullable = false)
|
@Column(name = "workflow_definition_id", nullable = false)
|
||||||
private Long workflowDefinitionId;
|
private Long workflowDefinitionId;
|
||||||
|
|
||||||
|
@Type(JsonType.class)
|
||||||
|
@Column(name = "form_variables_schema", columnDefinition = "text")
|
||||||
|
private JsonNode formVariablesSchema;
|
||||||
|
|
||||||
@Type(JsonType.class)
|
@Type(JsonType.class)
|
||||||
@Column(name = "build_variables", columnDefinition = "text", nullable = false)
|
@Column(name = "build_variables", columnDefinition = "text", nullable = false)
|
||||||
private JsonNode buildVariables;
|
private JsonNode buildVariables;
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.enums;
|
package com.qqchen.deploy.backend.deploy.enums;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import com.qqchen.deploy.backend.deploy.dto.variables.JenkinsJavaBuildVariables;
|
import com.qqchen.deploy.backend.deploy.dto.variables.build.JenkinsJavaBuildVariables;
|
||||||
import com.qqchen.deploy.backend.deploy.dto.variables.JenkinsNodeJsBuildVariables;
|
import com.qqchen.deploy.backend.deploy.dto.variables.build.JenkinsNodeJsBuildVariables;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.variables.form.BuildFormVariables;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,6 +21,7 @@ public enum BuildTypeEnum {
|
|||||||
DevelopmentLanguageTypeEnum.GO,
|
DevelopmentLanguageTypeEnum.GO,
|
||||||
DevelopmentLanguageTypeEnum.PYTHON
|
DevelopmentLanguageTypeEnum.PYTHON
|
||||||
},
|
},
|
||||||
|
BuildFormVariables.class,
|
||||||
new Class[] {
|
new Class[] {
|
||||||
JenkinsJavaBuildVariables.class,
|
JenkinsJavaBuildVariables.class,
|
||||||
JenkinsNodeJsBuildVariables.class,
|
JenkinsNodeJsBuildVariables.class,
|
||||||
@ -28,11 +30,28 @@ public enum BuildTypeEnum {
|
|||||||
},
|
},
|
||||||
"Jenkins构建"
|
"Jenkins构建"
|
||||||
),
|
),
|
||||||
|
NATIVE(
|
||||||
|
"NATIVE",
|
||||||
|
"Native构建",
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
"Native构建"
|
||||||
|
),
|
||||||
|
CODE_ARTS(
|
||||||
|
"CODE_ARTS",
|
||||||
|
"CodeArts构建",
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
"CodeArts构建"
|
||||||
|
),
|
||||||
GITLAB_RUNNER(
|
GITLAB_RUNNER(
|
||||||
"GITLAB_RUNNER",
|
"GITLAB_RUNNER",
|
||||||
"GitLab Runner构建",
|
"GitLab Runner构建",
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
null,
|
||||||
"GitLab Runner构建"
|
"GitLab Runner构建"
|
||||||
),
|
),
|
||||||
GITHUB_ACTION(
|
GITHUB_ACTION(
|
||||||
@ -40,6 +59,7 @@ public enum BuildTypeEnum {
|
|||||||
"GitHub Action构建",
|
"GitHub Action构建",
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
null,
|
||||||
"GitHub Action构建"
|
"GitHub Action构建"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -50,14 +70,17 @@ public enum BuildTypeEnum {
|
|||||||
|
|
||||||
private final DevelopmentLanguageTypeEnum[] supportedLanguages;
|
private final DevelopmentLanguageTypeEnum[] supportedLanguages;
|
||||||
|
|
||||||
|
private final Class<?> formVariablesSchema;
|
||||||
|
|
||||||
private final Class<?>[] buildVariables;
|
private final Class<?>[] buildVariables;
|
||||||
|
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
BuildTypeEnum(String code, String name, DevelopmentLanguageTypeEnum[] supportedLanguages, Class<?>[] buildVariables, String description) {
|
BuildTypeEnum(String code, String name, DevelopmentLanguageTypeEnum[] supportedLanguages, Class<?> formVariablesSchema, Class<?>[] buildVariables, String description) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.supportedLanguages = supportedLanguages;
|
this.supportedLanguages = supportedLanguages;
|
||||||
|
this.formVariablesSchema = formVariablesSchema;
|
||||||
this.buildVariables = buildVariables;
|
this.buildVariables = buildVariables;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,13 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.service.impl;
|
package com.qqchen.deploy.backend.deploy.service.impl;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import com.qqchen.deploy.backend.deploy.converter.ApplicationConverter;
|
import com.qqchen.deploy.backend.deploy.converter.ApplicationConverter;
|
||||||
import com.qqchen.deploy.backend.deploy.dto.ApplicationDTO;
|
|
||||||
import com.qqchen.deploy.backend.deploy.dto.BuildConfigDefinedDTO;
|
import com.qqchen.deploy.backend.deploy.dto.BuildConfigDefinedDTO;
|
||||||
import com.qqchen.deploy.backend.deploy.dto.DeployAppConfigDTO;
|
import com.qqchen.deploy.backend.deploy.dto.DeployAppConfigDTO;
|
||||||
import com.qqchen.deploy.backend.deploy.entity.Application;
|
import com.qqchen.deploy.backend.deploy.entity.Application;
|
||||||
import com.qqchen.deploy.backend.deploy.entity.DeployAppConfig;
|
import com.qqchen.deploy.backend.deploy.entity.DeployAppConfig;
|
||||||
import com.qqchen.deploy.backend.deploy.entity.ProjectGroup;
|
|
||||||
import com.qqchen.deploy.backend.deploy.enums.BuildTypeEnum;
|
import com.qqchen.deploy.backend.deploy.enums.BuildTypeEnum;
|
||||||
import com.qqchen.deploy.backend.deploy.enums.DevelopmentLanguageTypeEnum;
|
import com.qqchen.deploy.backend.deploy.enums.DevelopmentLanguageTypeEnum;
|
||||||
import com.qqchen.deploy.backend.deploy.query.ApplicationQuery;
|
|
||||||
import com.qqchen.deploy.backend.deploy.query.DeployAppConfigQuery;
|
import com.qqchen.deploy.backend.deploy.query.DeployAppConfigQuery;
|
||||||
import com.qqchen.deploy.backend.deploy.repository.IApplicationRepository;
|
import com.qqchen.deploy.backend.deploy.repository.IApplicationRepository;
|
||||||
import com.qqchen.deploy.backend.deploy.service.IDeployAppConfigService;
|
import com.qqchen.deploy.backend.deploy.service.IDeployAppConfigService;
|
||||||
@ -17,6 +15,7 @@ import com.qqchen.deploy.backend.framework.service.impl.BaseServiceImpl;
|
|||||||
import com.qqchen.deploy.backend.workflow.converter.WorkflowDefinitionConverter;
|
import com.qqchen.deploy.backend.workflow.converter.WorkflowDefinitionConverter;
|
||||||
import com.qqchen.deploy.backend.workflow.entity.WorkflowDefinition;
|
import com.qqchen.deploy.backend.workflow.entity.WorkflowDefinition;
|
||||||
import com.qqchen.deploy.backend.workflow.repository.IWorkflowDefinitionRepository;
|
import com.qqchen.deploy.backend.workflow.repository.IWorkflowDefinitionRepository;
|
||||||
|
import com.qqchen.deploy.backend.workflow.util.GenerateSchemaUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@ -24,6 +23,7 @@ import org.springframework.data.domain.PageImpl;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@ -90,4 +90,12 @@ public class DeployAppConfigServiceImpl extends BaseServiceImpl<DeployAppConfig,
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeployAppConfigDTO create(DeployAppConfigDTO dto) {
|
||||||
|
DeployAppConfig entity = converter.toEntity(dto);
|
||||||
|
entity.setFormVariablesSchema(generateSchema(dto.getBuildType().getFormVariablesSchema()));
|
||||||
|
this.repository.save(entity);
|
||||||
|
return converter.toDto(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.qqchen.deploy.backend.workflow.annotation;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.workflow.enums.CompareOperatorEnums;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schema属性的可见性条件配置
|
||||||
|
*
|
||||||
|
* <p>使用示例:
|
||||||
|
* <pre>
|
||||||
|
* {@code
|
||||||
|
* @SchemaProperty(
|
||||||
|
* title = "Jenkins任务",
|
||||||
|
* visibleOn = @SchemaPropertyVisibleOn(
|
||||||
|
* field = "buildType",
|
||||||
|
* value = "JENKINS"
|
||||||
|
* )
|
||||||
|
* )
|
||||||
|
* private String jenkinsJob;
|
||||||
|
*
|
||||||
|
* @SchemaProperty(
|
||||||
|
* title = "共享配置",
|
||||||
|
* visibleOn = {
|
||||||
|
* @SchemaPropertyVisibleOn(
|
||||||
|
* field = "buildType",
|
||||||
|
* value = {"JENKINS", "NATIVE"},
|
||||||
|
* operator = CompareOperator.IN
|
||||||
|
* )
|
||||||
|
* }
|
||||||
|
* )
|
||||||
|
* private String sharedConfig;
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@Target({})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface SchemaPropertyVisibleOn {
|
||||||
|
/**
|
||||||
|
* 依赖的字段名
|
||||||
|
*/
|
||||||
|
String field() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段值
|
||||||
|
* 支持单个值或多个值
|
||||||
|
*/
|
||||||
|
String[] value() default {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比较操作符
|
||||||
|
*/
|
||||||
|
CompareOperatorEnums operator() default CompareOperatorEnums.EQUAL;
|
||||||
|
}
|
||||||
@ -62,7 +62,7 @@ public class WorkflowDefinitionDTO extends BaseDTO {
|
|||||||
private WorkflowDefinitionStatusEnums status;
|
private WorkflowDefinitionStatusEnums status;
|
||||||
|
|
||||||
|
|
||||||
private JsonNode formVariablesSchema;
|
private JsonNode localVariablesSchema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程描述
|
* 流程描述
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables;
|
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审批节点表单变量
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ApprovalNodeFormVariables extends BaseNodeFormVariables {
|
|
||||||
|
|
||||||
@SchemaProperty(
|
|
||||||
title = "审批意见",
|
|
||||||
description = "请填写审批意见",
|
|
||||||
required = true
|
|
||||||
)
|
|
||||||
private String comment;
|
|
||||||
|
|
||||||
@SchemaProperty(
|
|
||||||
title = "审批结果",
|
|
||||||
description = "请选择审批结果",
|
|
||||||
required = true,
|
|
||||||
enumValues = {"APPROVED", "REJECTED"},
|
|
||||||
enumNames = {"同意", "拒绝"}
|
|
||||||
)
|
|
||||||
private String approvalResult;
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables;
|
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 事件节点基础配置
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class BaseNodeFormVariables {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ScriptNodeFormVariables {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
//package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables_remove;
|
||||||
|
//
|
||||||
|
//import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
||||||
|
//import lombok.Data;
|
||||||
|
//import lombok.EqualsAndHashCode;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 审批节点表单变量
|
||||||
|
// */
|
||||||
|
//@Data
|
||||||
|
//@EqualsAndHashCode(callSuper = true)
|
||||||
|
//public class ApprovalNodeFormVariables extends BaseNodeFormVariables {
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "审批意见",
|
||||||
|
// description = "请填写审批意见",
|
||||||
|
// required = true
|
||||||
|
// )
|
||||||
|
// private String comment;
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "审批结果",
|
||||||
|
// description = "请选择审批结果",
|
||||||
|
// required = true,
|
||||||
|
// enumValues = {"APPROVED", "REJECTED"},
|
||||||
|
// enumNames = {"同意", "拒绝"}
|
||||||
|
// )
|
||||||
|
// private String approvalResult;
|
||||||
|
//}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
//package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables_remove;
|
||||||
|
//
|
||||||
|
//import lombok.Data;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 事件节点基础配置
|
||||||
|
// */
|
||||||
|
//@Data
|
||||||
|
//public class BaseNodeFormVariables {
|
||||||
|
//
|
||||||
|
//}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
//package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables_remove;
|
||||||
|
//
|
||||||
|
//import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
||||||
|
//import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSource;
|
||||||
|
//import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSourceParam;
|
||||||
|
//import lombok.Data;
|
||||||
|
//import lombok.EqualsAndHashCode;
|
||||||
|
//
|
||||||
|
//@Data
|
||||||
|
//@EqualsAndHashCode(callSuper = true)
|
||||||
|
//public class DeployNodeFormVariables extends BaseNodeFormVariables {
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "部署类型",
|
||||||
|
// description = "部署类型",
|
||||||
|
// required = true,
|
||||||
|
// enumValues = {
|
||||||
|
// "JENKINS",
|
||||||
|
// "NATIVE",
|
||||||
|
// },
|
||||||
|
// enumNames = {
|
||||||
|
// "Jenkins部署",
|
||||||
|
// "本地部署"
|
||||||
|
// },
|
||||||
|
// order = 1
|
||||||
|
// )
|
||||||
|
// private String gatewayType;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "绑定三方Jenkins系统",
|
||||||
|
// description = "请选择三方Jenkins系统",
|
||||||
|
// required = true,
|
||||||
|
// dataSource = @SchemaPropertyDataSource(
|
||||||
|
// type = "api",
|
||||||
|
// url = "/api/v1/external-system/list?type=JENKINS",
|
||||||
|
// valueField = "id",
|
||||||
|
// labelField = "name"
|
||||||
|
// ),
|
||||||
|
// order = 2
|
||||||
|
// )
|
||||||
|
// private String externalSystemId;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "绑定Jenkins视图",
|
||||||
|
// description = "Jenkins视图",
|
||||||
|
// required = true,
|
||||||
|
// dataSource = @SchemaPropertyDataSource(
|
||||||
|
// type = "api",
|
||||||
|
// url = "/api/v1/jenkins-view/list",
|
||||||
|
// valueField = "id",
|
||||||
|
// labelField = "viewName",
|
||||||
|
// dependsOn = {"externalSystemId"},
|
||||||
|
// params = {
|
||||||
|
// @SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}")
|
||||||
|
// }
|
||||||
|
// ),
|
||||||
|
// order = 3
|
||||||
|
// )
|
||||||
|
// private String viewId;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "绑定Jenkins任务",
|
||||||
|
// description = "Jenkins任务",
|
||||||
|
// required = true,
|
||||||
|
// dataSource = @SchemaPropertyDataSource(
|
||||||
|
// type = "api",
|
||||||
|
// url = "/api/v1/jenkins-job/list",
|
||||||
|
// valueField = "id",
|
||||||
|
// labelField = "jobName",
|
||||||
|
// dependsOn = {"externalSystemId", "viewId"},
|
||||||
|
// params = {
|
||||||
|
// @SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}"),
|
||||||
|
// @SchemaPropertyDataSourceParam(name = "viewId", value = "${viewId}")
|
||||||
|
// }
|
||||||
|
// ),
|
||||||
|
// order = 4
|
||||||
|
// )
|
||||||
|
// private String jobId;
|
||||||
|
//
|
||||||
|
//}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
//package com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables_remove;
|
||||||
|
//
|
||||||
|
//import lombok.Data;
|
||||||
|
//
|
||||||
|
//@Data
|
||||||
|
//public class ScriptNodeFormVariables {
|
||||||
|
//
|
||||||
|
//}
|
||||||
@ -3,9 +3,6 @@ package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
|||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
|
||||||
* 审批节点运行时变量
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
public class ApprovalNodeLocalVariables {
|
public class ApprovalNodeLocalVariables {
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,5 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统需要使用的变量
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class BaseNodeLocalVariables {
|
public class BaseNodeLocalVariables {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,83 @@
|
|||||||
|
//package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
||||||
|
//
|
||||||
|
//import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
||||||
|
//import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSource;
|
||||||
|
//import com.qqchen.deploy.backend.workflow.annotation.SchemaPropertyDataSourceParam;
|
||||||
|
//import lombok.Data;
|
||||||
|
//import lombok.EqualsAndHashCode;
|
||||||
|
//
|
||||||
|
//@Data
|
||||||
|
//@EqualsAndHashCode(callSuper = true)
|
||||||
|
//public class DeployNodeFormVariables extends BaseNodeLocalVariables {
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "部署类型",
|
||||||
|
// description = "部署类型",
|
||||||
|
// required = true,
|
||||||
|
// enumValues = {
|
||||||
|
// "JENKINS",
|
||||||
|
// "NATIVE",
|
||||||
|
// },
|
||||||
|
// enumNames = {
|
||||||
|
// "Jenkins部署",
|
||||||
|
// "本地部署"
|
||||||
|
// },
|
||||||
|
// order = 1
|
||||||
|
// )
|
||||||
|
// private String buildType;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "绑定三方Jenkins系统",
|
||||||
|
// description = "请选择三方Jenkins系统",
|
||||||
|
// required = true,
|
||||||
|
// dataSource = @SchemaPropertyDataSource(
|
||||||
|
// type = "api",
|
||||||
|
// url = "/api/v1/external-system/list?type=JENKINS",
|
||||||
|
// valueField = "id",
|
||||||
|
// labelField = "name"
|
||||||
|
// ),
|
||||||
|
// order = 2
|
||||||
|
// )
|
||||||
|
// private String externalSystemId;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "绑定Jenkins视图",
|
||||||
|
// description = "Jenkins视图",
|
||||||
|
// required = true,
|
||||||
|
// dataSource = @SchemaPropertyDataSource(
|
||||||
|
// type = "api",
|
||||||
|
// url = "/api/v1/jenkins-view/list",
|
||||||
|
// valueField = "id",
|
||||||
|
// labelField = "viewName",
|
||||||
|
// dependsOn = {"externalSystemId"},
|
||||||
|
// params = {
|
||||||
|
// @SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}")
|
||||||
|
// }
|
||||||
|
// ),
|
||||||
|
// order = 3
|
||||||
|
// )
|
||||||
|
// private String viewId;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @SchemaProperty(
|
||||||
|
// title = "绑定Jenkins任务",
|
||||||
|
// description = "Jenkins任务",
|
||||||
|
// required = true,
|
||||||
|
// dataSource = @SchemaPropertyDataSource(
|
||||||
|
// type = "api",
|
||||||
|
// url = "/api/v1/jenkins-job/list",
|
||||||
|
// valueField = "id",
|
||||||
|
// labelField = "jobName",
|
||||||
|
// dependsOn = {"externalSystemId", "viewId"},
|
||||||
|
// params = {
|
||||||
|
// @SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}"),
|
||||||
|
// @SchemaPropertyDataSourceParam(name = "viewId", value = "${viewId}")
|
||||||
|
// }
|
||||||
|
// ),
|
||||||
|
// order = 4
|
||||||
|
// )
|
||||||
|
// private String jobId;
|
||||||
|
//
|
||||||
|
//}
|
||||||
@ -1,30 +1,27 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
||||||
|
|
||||||
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;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
public class DeployNodeLocalVariables extends BaseNodeLocalVariables {
|
public class DeployNodeLocalVariables extends BaseNodeLocalVariables {
|
||||||
|
|
||||||
|
|
||||||
|
@SchemaProperty(
|
||||||
|
title = "三方Jenkins系统",
|
||||||
|
description = "三方Jenkins系统",
|
||||||
|
required = true
|
||||||
|
)
|
||||||
|
private String externalSystemId;
|
||||||
|
|
||||||
|
|
||||||
@SchemaProperty(
|
@SchemaProperty(
|
||||||
title = "绑定Jenkins视图",
|
title = "绑定Jenkins视图",
|
||||||
description = "Jenkins视图",
|
description = "Jenkins视图",
|
||||||
required = true,
|
required = true,
|
||||||
dataSource = @SchemaPropertyDataSource(
|
order = 3
|
||||||
type = "api",
|
|
||||||
url = "/api/v1/jenkins-view/list",
|
|
||||||
valueField = "id",
|
|
||||||
labelField = "viewName",
|
|
||||||
dependsOn = {"externalSystemId"},
|
|
||||||
params = {
|
|
||||||
@SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}")
|
|
||||||
}
|
|
||||||
),
|
|
||||||
order = 2
|
|
||||||
)
|
)
|
||||||
private String viewId;
|
private String viewId;
|
||||||
|
|
||||||
@ -33,18 +30,7 @@ public class DeployNodeLocalVariables extends BaseNodeLocalVariables {
|
|||||||
title = "绑定Jenkins任务",
|
title = "绑定Jenkins任务",
|
||||||
description = "Jenkins任务",
|
description = "Jenkins任务",
|
||||||
required = true,
|
required = true,
|
||||||
dataSource = @SchemaPropertyDataSource(
|
order = 4
|
||||||
type = "api",
|
|
||||||
url = "/api/v1/jenkins-job/list",
|
|
||||||
valueField = "id",
|
|
||||||
labelField = "jobName",
|
|
||||||
dependsOn = {"externalSystemId", "viewId"},
|
|
||||||
params = {
|
|
||||||
@SchemaPropertyDataSourceParam(name = "externalSystemId", value = "${externalSystemId}"),
|
|
||||||
@SchemaPropertyDataSourceParam(name = "viewId", value = "${viewId}")
|
|
||||||
}
|
|
||||||
),
|
|
||||||
order = 3
|
|
||||||
)
|
)
|
||||||
private String jobId;
|
private String jobId;
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class GatewayNodeLocalVariables extends BaseNodeLocalVariables {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
package com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables;
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.workflow.annotation.SchemaProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|||||||
@ -80,8 +80,8 @@ public class WorkflowDefinition extends Entity<Long> {
|
|||||||
* 表单配置
|
* 表单配置
|
||||||
*/
|
*/
|
||||||
@Type(JsonType.class)
|
@Type(JsonType.class)
|
||||||
@Column(name = "form_variables_schema", columnDefinition = "json")
|
@Column(name = "local_variables_schema", columnDefinition = "json")
|
||||||
private JsonNode formVariablesSchema;
|
private JsonNode localVariablesSchema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程状态
|
* 流程状态
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.qqchen.deploy.backend.workflow.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比较操作符枚举
|
||||||
|
*/
|
||||||
|
public enum CompareOperatorEnums {
|
||||||
|
/**
|
||||||
|
* 等于
|
||||||
|
*/
|
||||||
|
EQUAL,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不等于
|
||||||
|
*/
|
||||||
|
NOT_EQUAL,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在列表中
|
||||||
|
*/
|
||||||
|
IN,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不在列表中
|
||||||
|
*/
|
||||||
|
NOT_IN
|
||||||
|
}
|
||||||
@ -1,13 +1,9 @@
|
|||||||
package com.qqchen.deploy.backend.workflow.enums;
|
package com.qqchen.deploy.backend.workflow.enums;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables.DeployNodeFormVariables;
|
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables.ScriptNodeFormVariables;
|
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.fromVariables.ApprovalNodeFormVariables;
|
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables.DeployNodeLocalVariables;
|
import com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables.DeployNodeLocalVariables;
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables.NotificationNodeLocalVariables;
|
import com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables.NotificationNodeLocalVariables;
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables.ScriptNodeLocalVariables;
|
import com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables.ScriptNodeLocalVariables;
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.localVariables.ApprovalNodeLocalVariables;
|
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.panelVariables.DeployNodePanelVariables;
|
import com.qqchen.deploy.backend.workflow.dto.definition.node.panelVariables.DeployNodePanelVariables;
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.panelVariables.EndNodePanelVariables;
|
import com.qqchen.deploy.backend.workflow.dto.definition.node.panelVariables.EndNodePanelVariables;
|
||||||
import com.qqchen.deploy.backend.workflow.dto.definition.node.panelVariables.GatewayNodePanelVariables;
|
import com.qqchen.deploy.backend.workflow.dto.definition.node.panelVariables.GatewayNodePanelVariables;
|
||||||
@ -103,8 +99,8 @@ public enum NodeTypeEnums {
|
|||||||
APPROVAL_NODE(
|
APPROVAL_NODE(
|
||||||
"APPROVAL_NODE",
|
"APPROVAL_NODE",
|
||||||
"审批节点",
|
"审批节点",
|
||||||
ApprovalNodeLocalVariables.class,
|
null,
|
||||||
ApprovalNodePanelVariables.class,
|
null,
|
||||||
NodeUiVariables.class,
|
NodeUiVariables.class,
|
||||||
BpmnNodeTypeEnums.USER_TASK,
|
BpmnNodeTypeEnums.USER_TASK,
|
||||||
NodeCategoryEnums.TASK,
|
NodeCategoryEnums.TASK,
|
||||||
|
|||||||
@ -402,34 +402,34 @@ CREATE TABLE deploy_repo_branch
|
|||||||
CREATE TABLE workflow_definition
|
CREATE TABLE workflow_definition
|
||||||
(
|
(
|
||||||
-- 主键
|
-- 主键
|
||||||
id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
|
id BIGINT PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID',
|
||||||
|
|
||||||
-- 基础信息
|
-- 基础信息
|
||||||
name VARCHAR(255) NOT NULL COMMENT '流程名称',
|
name VARCHAR(255) NOT NULL COMMENT '流程名称',
|
||||||
`key` VARCHAR(255) NOT NULL COMMENT '流程标识',
|
`key` VARCHAR(255) NOT NULL COMMENT '流程标识',
|
||||||
category VARCHAR(100) COMMENT '流程分类',
|
category VARCHAR(100) COMMENT '流程分类',
|
||||||
triggers VARCHAR(200) COMMENT '流程分类',
|
triggers VARCHAR(200) COMMENT '流程分类',
|
||||||
process_definition_id VARCHAR(100) NULL COMMENT '工作流定义ID',
|
process_definition_id VARCHAR(100) NULL COMMENT '工作流定义ID',
|
||||||
flow_version INT NOT NULL COMMENT '流程版本',
|
flow_version INT NOT NULL COMMENT '流程版本',
|
||||||
description TEXT COMMENT '流程描述',
|
description TEXT COMMENT '流程描述',
|
||||||
|
|
||||||
-- 流程配置
|
-- 流程配置
|
||||||
bpmn_xml TEXT COMMENT 'BPMN XML内容',
|
bpmn_xml TEXT COMMENT 'BPMN XML内容',
|
||||||
graph JSON COMMENT '流程图数据,包含节点和连线的位置、样式等信息',
|
graph JSON COMMENT '流程图数据,包含节点和连线的位置、样式等信息',
|
||||||
form_variables_schema JSON COMMENT '表单配置',
|
local_variables_schema JSON COMMENT '节点变量Schema',
|
||||||
tags JSON COMMENT '流程标签',
|
tags JSON COMMENT '流程标签',
|
||||||
|
|
||||||
-- 流程属性
|
-- 流程属性
|
||||||
status VARCHAR(50) NOT NULL COMMENT '流程状态(DRAFT-草稿、PUBLISHED-已发布、DISABLED-已禁用)',
|
status VARCHAR(50) NOT NULL COMMENT '流程状态(DRAFT-草稿、PUBLISHED-已发布、DISABLED-已禁用)',
|
||||||
is_executable BOOLEAN NOT NULL DEFAULT TRUE COMMENT '是否可执行',
|
is_executable BOOLEAN NOT NULL DEFAULT TRUE COMMENT '是否可执行',
|
||||||
target_namespace VARCHAR(255) DEFAULT 'http://www.flowable.org/test' COMMENT '目标命名空间',
|
target_namespace VARCHAR(255) DEFAULT 'http://www.flowable.org/test' COMMENT '目标命名空间',
|
||||||
|
|
||||||
-- 审计字段
|
-- 审计字段
|
||||||
created_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
|
created_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
|
||||||
updated_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间',
|
updated_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间',
|
||||||
created_by BIGINT COMMENT '创建人',
|
created_by BIGINT COMMENT '创建人',
|
||||||
updated_by BIGINT COMMENT '更新人',
|
updated_by BIGINT COMMENT '更新人',
|
||||||
is_deleted BOOLEAN NOT NULL DEFAULT FALSE COMMENT '是否删除',
|
is_deleted BOOLEAN NOT NULL DEFAULT FALSE COMMENT '是否删除',
|
||||||
|
|
||||||
-- 约束
|
-- 约束
|
||||||
UNIQUE KEY uk_key_version (`key`, flow_version)
|
UNIQUE KEY uk_key_version (`key`, flow_version)
|
||||||
|
|||||||
@ -194,7 +194,7 @@ INSERT INTO workflow_definition (
|
|||||||
-- 基础信息
|
-- 基础信息
|
||||||
name, `key`, process_definition_id, flow_version, description, category, triggers,
|
name, `key`, process_definition_id, flow_version, description, category, triggers,
|
||||||
-- 流程配置
|
-- 流程配置
|
||||||
graph, form_variables_schema, tags,
|
graph, local_variables_schema, tags,
|
||||||
-- 流程属性
|
-- 流程属性
|
||||||
status, is_executable, target_namespace,
|
status, is_executable, target_namespace,
|
||||||
-- 审计字段
|
-- 审计字段
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user