Merge branch 'temp' of http://1.14.125.6:3000/mianbin/ops-pro into temp
# Conflicts: # modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/stage/impl/StageServiceImpl.java
This commit is contained in:
commit
cd5c9637ee
@ -4,5 +4,10 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StageUpdateReq {
|
||||
// private
|
||||
// 更新名称
|
||||
private String stageName;
|
||||
// 更新sort
|
||||
private Integer stageSort;
|
||||
private String stageId;
|
||||
private String pipelineId;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cd.casic.ci.process.process.service.stage;
|
||||
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageCreateReq;
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageReq;
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageUpdateReq;
|
||||
import cd.casic.ci.common.pipeline.resp.stage.StageResp;
|
||||
import cd.casic.ci.process.process.dataObject.stage.PipStage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -19,27 +20,6 @@ public interface StageService extends IService<PipStage> {
|
||||
String createStagesOrTask(StageCreateReq stage);
|
||||
|
||||
|
||||
/**
|
||||
* 创建阶段模板
|
||||
* @param pipelineId 流水线id
|
||||
* @param template 模板
|
||||
*/
|
||||
void createStageTemplate(String pipelineId,String[] template);
|
||||
|
||||
|
||||
/**
|
||||
* 克隆阶段任务
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
void cloneStage(String pipelineId,String clonePipelineId);
|
||||
|
||||
/**
|
||||
* 查询所有阶段任务以及任务详情
|
||||
* @param pipelineId 流水线id
|
||||
* @return 任务
|
||||
*/
|
||||
List<StageResp> findAllStagesOrTask(String pipelineId);
|
||||
|
||||
/**
|
||||
* 查询所有阶段任务
|
||||
* @param pipelineId 流水线id
|
||||
@ -59,11 +39,6 @@ public interface StageService extends IService<PipStage> {
|
||||
*/
|
||||
void deleteAllStagesOrTask(String pipelineId);
|
||||
|
||||
/**
|
||||
* 更新阶段名称
|
||||
* @param stage 阶段
|
||||
*/
|
||||
void updateStageName(StageReq stage);
|
||||
|
||||
/**
|
||||
* 获取所有阶段的根节点
|
||||
@ -83,7 +58,7 @@ public interface StageService extends IService<PipStage> {
|
||||
* 更新阶段任务
|
||||
* @param stage 更新内容
|
||||
*/
|
||||
void updateStagesTask(StageReq stage);
|
||||
void updateStagesTask(StageUpdateReq stage);
|
||||
|
||||
|
||||
/**
|
||||
@ -93,13 +68,6 @@ public interface StageService extends IService<PipStage> {
|
||||
*/
|
||||
List<String> validStagesMustField(String pipelineId);
|
||||
|
||||
/**
|
||||
* 创建阶段
|
||||
* @param stage 阶段信息
|
||||
* @return 阶段id
|
||||
*/
|
||||
String createStages(PipStage stage);
|
||||
|
||||
/**
|
||||
* 更新阶段
|
||||
* @param stage 阶段信息
|
||||
@ -112,22 +80,6 @@ public interface StageService extends IService<PipStage> {
|
||||
*/
|
||||
void deleteStages(String stageId);
|
||||
|
||||
/**
|
||||
* 查询单个阶段
|
||||
* @param stageId 阶段id
|
||||
* @return 阶段信息
|
||||
*/
|
||||
PipStage findOneStages(String stageId);
|
||||
|
||||
/**
|
||||
* 查询所有阶段
|
||||
* @return 阶段信息集合
|
||||
*/
|
||||
|
||||
List<StageResp> findAllStages();
|
||||
|
||||
List<StageResp> findAllStagesList(List<String> idList);
|
||||
|
||||
|
||||
void createStagesOrTaskList(@Valid @NotNull List<StageCreateReq> stageList);
|
||||
|
||||
|
@ -5,6 +5,7 @@ import cd.casic.ci.common.pipeline.req.stage.StageCreateReq;
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageReq;
|
||||
import cd.casic.ci.common.pipeline.req.task.TaskCreateReq;
|
||||
import cd.casic.ci.common.pipeline.resp.stage.StageResp;
|
||||
|
||||
import cd.casic.ci.process.process.dal.pipeline.PipStageDao;
|
||||
import cd.casic.ci.process.process.dataObject.stage.PipStage;
|
||||
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
||||
@ -30,6 +31,9 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cd.casic.ci.process.constant.PipelineFinalConstant.TASK_TYPE_CODE;
|
||||
|
||||
@Service
|
||||
public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> implements StageService {
|
||||
@ -135,41 +139,6 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
taskService.save(pipTask);
|
||||
return pipTask.getTaskId();
|
||||
}
|
||||
/**
|
||||
* 更新主节点阶段顺序
|
||||
* @param pipelineId 流水线id
|
||||
* @param taskSort 顺序
|
||||
* @return 顺序
|
||||
*/
|
||||
private Integer initStage(String pipelineId,int taskSort){
|
||||
List<PipStage> allMainStage = findAllMainStage(pipelineId);
|
||||
if (allMainStage.isEmpty()){
|
||||
return 1;
|
||||
}
|
||||
for (PipStage stages : allMainStage) {
|
||||
int stage = stages.getStageSort();
|
||||
if (stage < taskSort){
|
||||
continue;
|
||||
}
|
||||
stages.setStageSort(stage+1);
|
||||
updateStages(stages);
|
||||
}
|
||||
return taskSort;
|
||||
}
|
||||
@Override
|
||||
public void createStageTemplate(String pipelineId, String[] template) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cloneStage(String pipelineId, String clonePipelineId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StageResp> findAllStagesOrTask(String pipelineId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StageResp> findAllStagesTask(String pipelineId) {
|
||||
@ -185,7 +154,7 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
List<PipStage> allStageStage = findOtherStageNoTask(stagesId);
|
||||
List<StageResp> stageRespList = allStageStage.stream().map(it -> {
|
||||
StageResp stageResp = new StageResp();
|
||||
BeanUtils.copyProperties(stageResp, it);
|
||||
BeanUtils.copyProperties(it, stageResp);
|
||||
return stageResp;
|
||||
}).toList();
|
||||
StageResp stageResp = new StageResp();
|
||||
@ -206,7 +175,7 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
return;
|
||||
}
|
||||
PipTask task = taskList.get(0);
|
||||
taskService.deleteTaskById(taskId);
|
||||
taskService.removeById(taskId);
|
||||
// 查询上一级stage下有无其他task 没有则连着stage删除
|
||||
String stageId = task.getStageId();
|
||||
String pipelineId = task.getPipelineId();
|
||||
@ -262,17 +231,6 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
return stageDao.selectList(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStageName(StageReq stage) {
|
||||
LambdaUpdateWrapper<PipStage> wrapper = new LambdaUpdateWrapper<>();
|
||||
if (StringUtils.isEmpty(stage.getStageName())||StringUtils.isEmpty(stage.getStageId())) {
|
||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"阶段Id和名称蹦年为空");
|
||||
}
|
||||
wrapper.eq(PipStage::getStageId,stage.getStageId());
|
||||
wrapper.set(PipStage::getStageName,stage.getStageName());
|
||||
stageDao.update(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipStage> findAllMainStage(String pipelineId) {
|
||||
LambdaQueryWrapper<PipStage> wrapper = new LambdaQueryWrapper<>();
|
||||
@ -280,9 +238,53 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
wrapper.eq(PipStage::getParentId,"-1");
|
||||
return stageDao.selectList(wrapper);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updateStagesTask(StageReq stage) {
|
||||
public void updateStagesTask(StageUpdateReq stage) {
|
||||
String stageId = stage.getStageId();
|
||||
String stageName = stage.getStageName();
|
||||
Integer currStageSort = stage.getStageSort();
|
||||
Long loginUserId = WebFrameworkUtils.getLoginUserId();
|
||||
PipStage updateStage = getById(stageId);
|
||||
if (updateStage==null) {
|
||||
return;
|
||||
}
|
||||
|
||||
updateStage.setUpdateUserId(loginUserId);
|
||||
updateStage.setUpdateTime(LocalDateTime.now());
|
||||
if (currStageSort == null) {
|
||||
updateStage.setStageName(stageName);
|
||||
updateById(updateStage);
|
||||
} else{
|
||||
Integer oldStageSort = updateStage.getStageSort();
|
||||
if (oldStageSort.equals(currStageSort)) {
|
||||
return;
|
||||
}
|
||||
PipStage query = new PipStage();
|
||||
query.setPipelineId(updateStage.getPipelineId());
|
||||
query.setParentId("-1");
|
||||
List<PipStage> stageList = getPipStageList(query);
|
||||
if (oldStageSort<currStageSort) {
|
||||
// 往右移动
|
||||
for (PipStage pipStage : stageList) {
|
||||
if (!pipStage.getStageId().equals(updateStage.getStageId())) {
|
||||
if (pipStage.getStageSort()>oldStageSort&&pipStage.getStageSort()<=currStageSort) {
|
||||
pipStage.setStageSort(pipStage.getStageSort()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 往左移动
|
||||
for (PipStage pipStage : stageList) {
|
||||
if (!pipStage.getStageId().equals(updateStage.getStageId())) {
|
||||
if (pipStage.getStageSort()<oldStageSort&&pipStage.getStageSort()>=currStageSort) {
|
||||
pipStage.setStageSort(pipStage.getStageSort()+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
updateBatchById(stageList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -291,11 +293,7 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createStages(PipStage stage) {
|
||||
stageDao.insert(stage);
|
||||
return stage.getStageId();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateStages(PipStage stage) {
|
||||
@ -307,20 +305,6 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
stageDao.deleteById(stageId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PipStage findOneStages(String stageId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StageResp> findAllStages() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StageResp> findAllStagesList(List<String> idList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createStagesOrTaskList(List<StageCreateReq> stageList) {
|
||||
@ -329,28 +313,15 @@ public class StageServiceImpl extends ServiceImpl<PipStageDao, PipStage> impleme
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断任务是否存在代码源
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
private void findTargetTasks(String pipelineId) {
|
||||
List<PipStage> allStage = findAllMainStage(pipelineId);
|
||||
if (allStage.isEmpty()){
|
||||
return;
|
||||
}
|
||||
for (PipStage stage : allStage) {
|
||||
if (stage.getCode()){
|
||||
throw new ServiceException(50001,"代码源已存在,无法再次创建。");
|
||||
}
|
||||
}
|
||||
}
|
||||
public List<PipStage> findOtherStageNoTask(String stagesId){
|
||||
List<PipStage> otherStage = findSecondStage(stagesId);
|
||||
List<PipStage> list = new ArrayList<>();
|
||||
List<String> stageIdList = otherStage.stream().map(PipStage::getStageId).toList();
|
||||
Map<String, List<PipTask>> stageIdTaskMap = taskService.listByIds(stageIdList).stream().collect(Collectors.groupingBy(PipTask::getStageId));
|
||||
for (PipStage stage : otherStage) {
|
||||
//获取阶段配置及任务
|
||||
String otherId = stage.getStageId();
|
||||
List<PipTask> allStageTask = taskService.finAllStageTask(otherId);
|
||||
List<PipTask> allStageTask = stageIdTaskMap.get(otherId);
|
||||
stage.setTaskValues(allStageTask);
|
||||
list.add(stage);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cd.casic.ci.process.process.service.task;
|
||||
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageCreateReq;
|
||||
import cd.casic.ci.common.pipeline.resp.task.TasksResp;
|
||||
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -11,9 +12,7 @@ public interface TaskService extends IService<PipTask> {
|
||||
* 查询taskType是否存在(原项目的各种worker)
|
||||
* */
|
||||
public void taskTypeExist(String taskType);
|
||||
public String createTasksOrTask(PipTask tasks);
|
||||
List<PipTask> finAllStageTask(String stageId);
|
||||
List<PipTask> getTask(PipTask pipTask);
|
||||
void deleteTaskById(String taskId);
|
||||
public TasksResp getById(String taskId);
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import cd.casic.ci.process.process.dal.pipeline.PipStageDao;
|
||||
import cd.casic.ci.process.process.dal.pipeline.PipTaskDao;
|
||||
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
||||
import cd.casic.ci.process.process.service.task.TaskService;
|
||||
import cd.casic.framework.commons.exception.ServiceException;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
@ -14,18 +14,18 @@ import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
|
||||
import org.springframework.core.type.filter.AnnotationTypeFilter;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static cd.casic.ci.process.constant.PipelineFinalConstant.TASK_TYPE_CODE;
|
||||
|
||||
@Service
|
||||
public class TaskServiceImpl extends ServiceImpl<PipTaskDao, PipTask> implements TaskService {
|
||||
@ -46,66 +46,16 @@ public class TaskServiceImpl extends ServiceImpl<PipTaskDao, PipTask> implements
|
||||
new ClassPathScanningCandidateComponentProvider(false);
|
||||
provider.addIncludeFilter(new AnnotationTypeFilter(Plugin.class));
|
||||
candidates = provider.findCandidateComponents(basePackage);
|
||||
for (BeanDefinition candidate : candidates) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void taskTypeExist(String taskType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTasksOrTask(PipTask tasks) {
|
||||
|
||||
int sort = 0;
|
||||
int taskSort = tasks.getTaskSort();
|
||||
String taskType = tasks.getTaskType();
|
||||
|
||||
//判断多任务是否存在代码源
|
||||
boolean b = TASK_TYPE_CODE.equals(taskType);
|
||||
if (tasks.getPipelineId() != null && (b) ){
|
||||
findCode(tasks.getPipelineId());
|
||||
}
|
||||
|
||||
//流水线任务
|
||||
String pipelineId = tasks.getPipelineId();
|
||||
if (pipelineId != null) {
|
||||
sort = initSort(tasks.getPipelineId(), taskSort, taskType,1);
|
||||
}
|
||||
|
||||
//阶段任务
|
||||
String stageId = tasks.getStageId();
|
||||
if (stageId != null){
|
||||
sort = initSort(stageId, taskSort, taskType,2);
|
||||
}
|
||||
// TODO 后置任务暂时空置
|
||||
// //后置任务
|
||||
// String postprocessId = tasks.getPostprocessId();
|
||||
// if (postprocessId != null){
|
||||
// sort = initSort(postprocessId, taskSort, taskType,3);
|
||||
// }
|
||||
|
||||
tasks.setTaskSort(sort);
|
||||
// 初始化名称
|
||||
if (Objects.isNull(tasks.getTaskName())){
|
||||
// String taskName = initDifferentTaskName(taskType);
|
||||
String taskName = "未命名";
|
||||
tasks.setTaskName(taskName);
|
||||
}
|
||||
|
||||
tasks.setCreateTime(LocalDateTime.now());
|
||||
|
||||
String tasksId = createTasks(tasks);
|
||||
//创建任务
|
||||
// createDifferentTask(tasksId,taskType,tasks.getValues());
|
||||
return tasksId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipTask> finAllStageTask(String stageId) {
|
||||
LambdaQueryWrapper<PipTask> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PipTask::getStageId,stageId);
|
||||
return taskDao.selectList(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PipTask> getTask(PipTask task) {
|
||||
LambdaQueryWrapper<PipTask> wrapper = new LambdaQueryWrapper<>();
|
||||
@ -126,107 +76,4 @@ public class TaskServiceImpl extends ServiceImpl<PipTaskDao, PipTask> implements
|
||||
BeanUtils.copyProperties(taskList.get(0),tasksResp);
|
||||
return tasksResp;
|
||||
}
|
||||
@Override
|
||||
public void deleteTaskById(String taskId) {
|
||||
taskDao.deleteById(taskId);
|
||||
}
|
||||
|
||||
void createDifferentTask(String taskId,String taskType,Object values){
|
||||
// TODO
|
||||
}
|
||||
/**
|
||||
* 查找目标节点是否存在
|
||||
* */
|
||||
private void findCode(String pipelineId){
|
||||
List<PipTask> tasks = finAllPipelineTask(pipelineId);
|
||||
if (tasks == null){
|
||||
return;
|
||||
}
|
||||
for (PipTask task : tasks) {
|
||||
String taskType = task.getTaskType();
|
||||
if (TASK_TYPE_CODE.equals(taskType)){
|
||||
throw new ServiceException(50001,"代码源已存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<PipTask> finAllPipelineTask(String pipelineId) {
|
||||
LambdaQueryWrapper<PipTask> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PipTask::getPipelineId,pipelineId);
|
||||
return taskDao.selectList(wrapper);
|
||||
}
|
||||
/**
|
||||
* 初始化配置顺序
|
||||
* @param id id
|
||||
* @param taskSort 插入顺序
|
||||
* @param taskType 任务类型
|
||||
* @param type 1.流水线id 2.阶段id
|
||||
* @return 顺序
|
||||
*/
|
||||
private Integer initSort(String id, int taskSort,String taskType,int type){
|
||||
List<PipTask> list = new ArrayList<>();
|
||||
if (type == 1){
|
||||
list = finAllPipelineTask(id);
|
||||
}
|
||||
if (type == 2){
|
||||
list = findAllStageTask(id);
|
||||
}
|
||||
// if (type == 3){
|
||||
// PipTask postTask = findOnePostTask(id);
|
||||
// if (postTask!= null){
|
||||
// list.add(postTask);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (list.isEmpty()){
|
||||
return 1;
|
||||
}
|
||||
|
||||
boolean b = TASK_TYPE_CODE.equals(taskType);
|
||||
|
||||
//插入的为代码源
|
||||
if (b){
|
||||
for (PipTask tasks : list) {
|
||||
tasks.setTaskSort(tasks.getTaskSort()+1);
|
||||
updateTasks(tasks);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
//更新顺序
|
||||
for (PipTask tasks : list) {
|
||||
if (tasks.getTaskSort() < taskSort ){
|
||||
continue;
|
||||
}
|
||||
tasks.setTaskSort(tasks.getTaskSort()+1);
|
||||
updateTasks(tasks);
|
||||
}
|
||||
return taskSort;
|
||||
|
||||
}
|
||||
|
||||
private void updateTasks(PipTask tasks){
|
||||
taskDao.updateById(tasks);
|
||||
}
|
||||
/**
|
||||
* 创建任务
|
||||
* @param tasks 任务模型
|
||||
* @return 任务id
|
||||
*/
|
||||
private String createTasks(PipTask tasks){
|
||||
taskDao.insert(tasks);
|
||||
return tasks.getTaskId();
|
||||
}
|
||||
/**
|
||||
* 根据stageId查询task
|
||||
* */
|
||||
private List<PipTask> findAllStageTask(String stageId) {
|
||||
// TasksQuery tasksQuery = new TasksQuery();
|
||||
// tasksQuery.setStageId(stageId);
|
||||
// List<TasksEntity> tasksEntityList = tasksDao.findTaskList(tasksQuery);
|
||||
// return BeanMapper.mapList(tasksEntityList, Tasks.class);
|
||||
LambdaQueryWrapper<PipTask> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PipTask::getStageId,stageId);
|
||||
return taskDao.selectList(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cd.casic.server.controller;
|
||||
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageCreateReq;
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageReq;
|
||||
import cd.casic.ci.common.pipeline.req.stage.StageUpdateReq;
|
||||
import cd.casic.ci.common.pipeline.resp.stage.StageResp;
|
||||
import cd.casic.ci.process.process.service.stage.StageService;
|
||||
import cd.casic.framework.commons.pojo.CommonResult;
|
||||
@ -13,10 +14,7 @@ import jakarta.annotation.security.PermitAll;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -47,13 +45,6 @@ public class StageController {
|
||||
return CommonResult.success(taskId);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(path="/createStageList",method = RequestMethod.POST)
|
||||
public CommonResult<String> createStagesOrTaskList(@RequestBody @Valid @NotNull List<StageCreateReq> stageList){
|
||||
stageService.createStagesOrTaskList(stageList);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* @pi.name:查询流水线阶段信息
|
||||
* @pi.path:/stage/finAllStage
|
||||
@ -69,33 +60,18 @@ public class StageController {
|
||||
}
|
||||
|
||||
/**
|
||||
* // TODO 暂时没发现哪里调用
|
||||
* @pi.name:更新流水线阶段任务
|
||||
* @pi.name:更新流水线阶段任务名称Or移动流水线阶段
|
||||
* @pi.path:/stage/createStage
|
||||
* @pi.methodType:post
|
||||
* @pi.request-type:json
|
||||
* @pi.param: model=stage
|
||||
*/
|
||||
@RequestMapping(path="/updateStage",method = RequestMethod.POST)
|
||||
public CommonResult<Void> updateStageTask(@RequestBody @Valid @NotNull StageReq stage){
|
||||
public CommonResult<Void> updateStageTask(@RequestBody @Valid @NotNull StageUpdateReq stage){
|
||||
stageService.updateStagesTask(stage);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* @pi.name:更新流水线阶段名称
|
||||
* @pi.path:/stage/updateStageName
|
||||
* @pi.methodType:post
|
||||
* @pi.request-type:json
|
||||
* @pi.param: model=stage
|
||||
*/
|
||||
@PermitAll
|
||||
@RequestMapping(path="/updateStageName",method = RequestMethod.POST)
|
||||
public CommonResult<Void> updateTasksStage(@RequestBody @Valid @NotNull StageReq stage){
|
||||
stageService.updateStageName(stage);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* @pi.name:删除流水线阶段及任务
|
||||
* @pi.path:/stage/deleteStage
|
||||
@ -103,27 +79,12 @@ public class StageController {
|
||||
* @pi.request-type: formdata
|
||||
* @pi.param: name=taskId;dataType=string;value=taskId;
|
||||
*/
|
||||
@RequestMapping(path="/deleteStage",method = RequestMethod.POST)
|
||||
@PostMapping(path="/deleteTasksOrStage")
|
||||
public CommonResult<Void> deleteTasksOrStage(@NotNull String taskId){
|
||||
stageService.deleteStagesOrTask(taskId);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* @pi.name:效验流水线各个配置阶段完整性
|
||||
* @pi.path:/stage/validStagesMustField
|
||||
* @pi.methodType:post
|
||||
* @pi.request-type: formdata
|
||||
* @pi.param: name=pipelineId;dataType=string;value=流水线Id;
|
||||
*/
|
||||
@RequestMapping(path="/validStagesMustField",method = RequestMethod.POST)
|
||||
public CommonResult<List<String>> validStagesMustField(@NotNull String pipelineId){
|
||||
// List<String> list = stageService.validStagesMustField(pipelineId);
|
||||
// return CommonResult.ok(list);
|
||||
return CommonResult.success(Collections.emptyList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user