| @@ -116,7 +116,7 @@ public class WorkflowController extends BaseController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑流水线") | @ApiOperation("编辑流水线") | ||||
| public GenericsAjaxResult<Workflow> edit(@RequestBody Workflow workflow) { | |||||
| public GenericsAjaxResult<Workflow> edit(@RequestBody Workflow workflow) throws Exception { | |||||
| return genericsSuccess(this.workflowService.update(workflow)); | return genericsSuccess(this.workflowService.update(workflow)); | ||||
| } | } | ||||
| @@ -59,7 +59,7 @@ public class Component implements Serializable { | |||||
| */ | */ | ||||
| @JsonProperty("env_variables") | @JsonProperty("env_variables") | ||||
| @ApiModelProperty(name = "env_variables", value = "环境变量") | @ApiModelProperty(name = "env_variables", value = "环境变量") | ||||
| @JsonRawValue | |||||
| //@JsonRawValue | |||||
| private String envVirables; | private String envVirables; | ||||
| /** | /** | ||||
| * 资源规格 | * 资源规格 | ||||
| @@ -80,13 +80,13 @@ public class Component implements Serializable { | |||||
| * 输入参数 | * 输入参数 | ||||
| */ | */ | ||||
| @ApiModelProperty(name = "in_parameters" ,value = "输入参数") | @ApiModelProperty(name = "in_parameters" ,value = "输入参数") | ||||
| @JsonRawValue | |||||
| //@JsonRawValue | |||||
| private String inParameters; | private String inParameters; | ||||
| /** | /** | ||||
| * 输出参数 | * 输出参数 | ||||
| */ | */ | ||||
| @ApiModelProperty(name = "out_parameters" ,value = "输出参数") | @ApiModelProperty(name = "out_parameters" ,value = "输出参数") | ||||
| @JsonRawValue | |||||
| //@JsonRawValue | |||||
| private String outParameters; | private String outParameters; | ||||
| /** | /** | ||||
| @@ -45,7 +45,7 @@ public interface WorkflowService { | |||||
| * @param workflow 实例对象 | * @param workflow 实例对象 | ||||
| * @return 实例对象 | * @return 实例对象 | ||||
| */ | */ | ||||
| Workflow update(Workflow workflow); | |||||
| Workflow update(Workflow workflow) throws Exception; | |||||
| /** | /** | ||||
| * 通过主键删除数据 | * 通过主键删除数据 | ||||
| @@ -110,8 +110,9 @@ public class WorkflowServiceImpl implements WorkflowService { | |||||
| * @return 实例对象 | * @return 实例对象 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Workflow update(Workflow workflow) { | |||||
| public Workflow update(Workflow workflow) throws Exception { | |||||
| LoginUser loginUser = SecurityUtils.getLoginUser(); | LoginUser loginUser = SecurityUtils.getLoginUser(); | ||||
| checkDeclaredName(workflow); | |||||
| workflow.setUpdateBy(loginUser.getUsername()); | workflow.setUpdateBy(loginUser.getUsername()); | ||||
| workflow.setUpdateTime(new Date()); | workflow.setUpdateTime(new Date()); | ||||
| this.workflowDao.update(workflow); | this.workflowDao.update(workflow); | ||||
| @@ -207,10 +208,9 @@ public class WorkflowServiceImpl implements WorkflowService { | |||||
| // 这是相同的流水线,更新操作中没有重复名称问题 | // 这是相同的流水线,更新操作中没有重复名称问题 | ||||
| return; | return; | ||||
| } | } | ||||
| // 现在我们知道还有另一个具有相同名称的流水线 | |||||
| Field[] fields = Workflow.class.getDeclaredFields(); | Field[] fields = Workflow.class.getDeclaredFields(); | ||||
| for (Field field : fields) { | for (Field field : fields) { | ||||
| field.setAccessible(true); // 使私有字段可访问 | |||||
| field.setAccessible(true); | |||||
| if ("name".equals(field.getName()) && field.isAnnotationPresent(CheckDuplicate.class)) { | if ("name".equals(field.getName()) && field.isAnnotationPresent(CheckDuplicate.class)) { | ||||
| // 如果字段是“name”并且标记了CheckDuplicate注解 | // 如果字段是“name”并且标记了CheckDuplicate注解 | ||||
| CheckDuplicate annotation = field.getAnnotation(CheckDuplicate.class); | CheckDuplicate annotation = field.getAnnotation(CheckDuplicate.class); | ||||
| @@ -103,6 +103,7 @@ public class WorkspaceServiceImpl implements WorkspaceService { | |||||
| assetCountMap.put("image", imageCount); | assetCountMap.put("image", imageCount); | ||||
| //统计组件数量 | //统计组件数量 | ||||
| Component component = new Component(); | Component component = new Component(); | ||||
| component.setAvailableRange(availableRange); | |||||
| Integer componentCount = (int) this.componentDao.count(component); | Integer componentCount = (int) this.componentDao.count(component); | ||||
| assetCountMap.put("component", componentCount); | assetCountMap.put("component", componentCount); | ||||
| //统计流水线数量 | //统计流水线数量 | ||||