|
|
@@ -1,12 +1,14 @@
|
|
|
package cn.seecoder.web.model.vo.pipeline;
|
|
|
|
|
|
+import cn.seecoder.web.model.po.pipeline.StageConfigPO;
|
|
|
import cn.seecoder.web.model.po.pipeline.StagePO;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
-import java.util.Map;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author PuHong Weng
|
|
|
@@ -26,19 +28,33 @@ public class StageVO {
|
|
|
@ApiModelProperty("描述信息")
|
|
|
private String description;
|
|
|
|
|
|
- @ApiModelProperty("仅作展示用的字段")
|
|
|
- private Map<String,String> fakeConfigs;
|
|
|
|
|
|
@ApiModelProperty("识别名称,用于转换成对应的流水线真实步骤Handler,见core包的 HandlerConfigTable")
|
|
|
private String name;
|
|
|
|
|
|
- @ApiModelProperty("可以配置的字段属性")
|
|
|
- private Map<String,String> configs;
|
|
|
+ @ApiModelProperty("配置的字段属性")
|
|
|
+ private List<StageConfigVO> configs;
|
|
|
|
|
|
- public StageVO(StagePO stagePO, Map<String,String> fakeConfigs, Map<String,String> configs){
|
|
|
+ public StageVO(StagePO stagePO, List<StageConfigPO> configs){
|
|
|
BeanUtils.copyProperties(stagePO,this);
|
|
|
- this.fakeConfigs = fakeConfigs;
|
|
|
- this.configs = configs;
|
|
|
+ this.configs = configs.stream().map(
|
|
|
+ x->{
|
|
|
+ StageConfigVO vo = new StageConfigVO();
|
|
|
+ BeanUtils.copyProperties(x,vo);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+ ).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
+ @Data
|
|
|
+ public static class StageConfigVO{
|
|
|
+ private Integer id;
|
|
|
+ private String name;
|
|
|
+ private String value;
|
|
|
+ /**
|
|
|
+ * true 则为学生不可以配置的属性,仅作展示用
|
|
|
+ * false 则为学生可以配置的属性
|
|
|
+ */
|
|
|
+ private Boolean editable;
|
|
|
+ }
|
|
|
}
|