大声道撒旦

This commit is contained in:
dengqichen 2024-12-27 14:22:10 +08:00
parent 5ed3c90526
commit f79e0db965
6 changed files with 22 additions and 0 deletions

View File

@ -36,6 +36,9 @@ public class DeployAppConfigDTO extends BaseDTO {
@NotNull(message = "应用语言不能为空")
private DevelopmentLanguageTypeEnum languageType;
@NotNull(message = "已发布的流程定义ID")
private Long workflowDefinitionId;
@Schema(description = "构建配置")
@NotNull(message = "构建配置不能为空")
private JsonNode buildVariables;

View File

@ -37,6 +37,9 @@ public class DeployAppConfig extends Entity<Long> {
@Enumerated(EnumType.STRING)
private DevelopmentLanguageTypeEnum languageType;
@Column(name = "workflow_definition_id", nullable = false)
private Long workflowDefinitionId;
@Type(JsonType.class)
@Column(name = "build_variables", columnDefinition = "text", nullable = false)
private JsonNode buildVariables;

View File

@ -52,6 +52,11 @@ public class WorkflowDefinitionApiController extends BaseController<WorkflowDefi
return Response.success(workflowDefinitionService.saveWorkflowDesign(dto));
}
@GetMapping("/published")
public Response<List<WorkflowDefinitionDTO>> findPublishedWorkflow() {
return Response.success(workflowDefinitionService.findPublishedWorkflow());
}
@PostMapping("/{workflowDefinitionId}/published")
public Response<Void> publishedWorkflowDesign(@PathVariable Long workflowDefinitionId) {
workflowDefinitionService.publishedWorkflowDesign(workflowDefinitionId);

View File

@ -1,12 +1,14 @@
package com.qqchen.deploy.backend.workflow.repository;
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
import com.qqchen.deploy.backend.workflow.dto.WorkflowDefinitionDTO;
import com.qqchen.deploy.backend.workflow.entity.WorkflowDefinition;
import com.qqchen.deploy.backend.workflow.enums.WorkflowDefinitionStatusEnums;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
/**
@ -27,4 +29,6 @@ public interface IWorkflowDefinitionRepository extends IBaseRepository<WorkflowD
Optional<WorkflowDefinition> findByKey(String businessKey);
Page<WorkflowDefinition> findByStatus(WorkflowDefinitionStatusEnums workflowStatusEnums, Pageable pageable);
List<WorkflowDefinitionDTO> findByStatus(WorkflowDefinitionStatusEnums workflowDefinitionStatusEnums);
}

View File

@ -61,4 +61,6 @@ public interface IWorkflowDefinitionService extends IBaseService<WorkflowDefinit
void publishedWorkflowDesign(Long workflowDefinitionId);
List<WorkflowCategoryDTO> getWorkflowCategories();
List<WorkflowDefinitionDTO> findPublishedWorkflow();
}

View File

@ -359,4 +359,9 @@ public class WorkflowDefinitionServiceImpl extends BaseServiceImpl<WorkflowDefin
.collect(Collectors.toList());
}
@Override
public List<WorkflowDefinitionDTO> findPublishedWorkflow() {
return workflowDefinitionRepository.findByStatus(WorkflowDefinitionStatusEnums.PUBLISHED);
}
}