Unverified Commit 48cf2b07 authored by Roy Wu(伍健君)'s avatar Roy Wu(伍健君) Committed by GitHub
Browse files

Merge pull request #2241 from WeBankPartners/dev

Dev
parents fb25362e 6e8a93f2
Showing with 733 additions and 165 deletions
+733 -165
......@@ -18,6 +18,8 @@ public class SimpleSubSystemDto implements Serializable {
private String apikey;
private boolean active;
private boolean blocked;
private String pubKey;
public String getName() {
return name;
......@@ -96,4 +98,14 @@ public class SimpleSubSystemDto implements Serializable {
return builder.toString();
}
public String getPubKey() {
return pubKey;
}
public void setPubKey(String pubKey) {
this.pubKey = pubKey;
}
}
......@@ -319,6 +319,7 @@ public class SubSystemManagementService {
dto.setName(subSystem.getName());
dto.setSystemCode(subSystem.getSystemCode());
dto.setApikey(subSystem.getApiKey());
dto.setPubKey(subSystem.getPubApiKey());
return dto;
}
......
......@@ -11,7 +11,7 @@
<artifactId>platform-core</artifactId>
<properties>
<app.version>3.0.1</app.version>
<app.version>3.1.0</app.version>
</properties>
<dependencyManagement>
......
package com.webank.wecube.platform.core.controller.plugin;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.zip.Deflater;
import java.util.zip.Inflater;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.webank.wecube.platform.core.commons.WecubeCoreException;
import com.webank.wecube.platform.core.dto.plugin.CommonResponseDto;
import com.webank.wecube.platform.core.dto.plugin.PluginCertificationDto;
import com.webank.wecube.platform.core.dto.plugin.PluginCertificationExportDto;
import com.webank.wecube.platform.core.service.plugin.PluginCertificationService;
@RestController
@RequestMapping("/v1")
public class PluginCertificationController {
private static final Logger log = LoggerFactory.getLogger(PluginCertificationController.class);
@Autowired
private PluginCertificationService pluginCertificationService;
private ObjectMapper objectMapper = new ObjectMapper();
@GetMapping("/plugin-certifications")
@PreAuthorize("hasAnyAuthority('ADMIN_CERTIFICATION','SUB_SYSTEM')")
public CommonResponseDto getAllPluginCertifications() {
List<PluginCertificationDto> resultDtos = pluginCertificationService.getAllPluginCertifications();
return CommonResponseDto.okayWithData(resultDtos);
}
@DeleteMapping("/plugin-certifications/{id}")
@PreAuthorize("hasAnyAuthority('ADMIN_CERTIFICATION','SUB_SYSTEM')")
public CommonResponseDto removePluginCertification(@PathVariable("id") String id) {
log.info("About to remove plugin certification by ID:{}", id);
pluginCertificationService.removePluginCertification(id);
return CommonResponseDto.okay();
}
@GetMapping(value = "/plugin-certifications/{id}/export", produces = { MediaType.ALL_VALUE })
@PreAuthorize("hasAnyAuthority('ADMIN_CERTIFICATION','SUB_SYSTEM')")
public ResponseEntity<byte[]> exportPluginCertification(@PathVariable("id") String id) {
log.info("About to export plugin certification of ID:{}", id);
PluginCertificationExportDto exportDto = pluginCertificationService.exportPluginCertification(id);
DateFormat df = new SimpleDateFormat("yyyyMMdd");
String sDate = df.format(new Date());
String filename = String.format("%s-%s.WeLic", exportDto.getPlugin(), sDate);
String jsonData = convertResultToString(exportDto);
byte[] zippedByteData = zipStringToBytes(jsonData);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.add("Content-Disposition", String.format("attachment;filename=%s", filename));
if (log.isInfoEnabled()) {
log.info("finished export plugin certification,size={},filename={}", zippedByteData.length, filename);
}
return ResponseEntity.ok().headers(headers).contentLength(zippedByteData.length)
.contentType(MediaType.APPLICATION_OCTET_STREAM).body(zippedByteData);
}
@PostMapping(value = "/plugin-certifications/import", consumes = { MediaType.MULTIPART_FORM_DATA_VALUE })
@PreAuthorize("hasAnyAuthority('ADMIN_CERTIFICATION','SUB_SYSTEM')")
public CommonResponseDto importPluginCertification(@RequestParam("uploadFile") MultipartFile file,
HttpServletRequest request) {
if (file == null || file.getSize() <= 0) {
log.error("invalid file content uploaded");
throw new WecubeCoreException("3128", "Invalid file content uploaded.");
}
if (log.isInfoEnabled()) {
log.info("About to import plugin certification,filename={},size={}", file.getOriginalFilename(),
file.getSize());
}
try {
byte[] filedata = IOUtils.toByteArray(file.getInputStream());
String jsonData = unzipBytesToString(filedata);
PluginCertificationExportDto pluginCertificationExportDto = convertStringToDto(jsonData);
// read value from file
PluginCertificationDto resultDto = pluginCertificationService
.importPluginCertification(pluginCertificationExportDto);
return CommonResponseDto.okayWithData(resultDto);
} catch (IOException e) {
log.error("errors while reading upload file", e);
throw new WecubeCoreException("Failed to import plugin certification:" + e.getMessage());
}
}
private byte[] zipStringToBytes(String content) {
byte[] data = content.getBytes(Charset.forName("UTF-8"));
byte[] output = new byte[0];
Deflater compresser = new Deflater();
ByteArrayOutputStream bos = null;
try {
compresser.reset();
compresser.setInput(data);
compresser.finish();
bos = new ByteArrayOutputStream(data.length);
byte[] buf = new byte[1024];
while (!compresser.finished()) {
int i = compresser.deflate(buf);
bos.write(buf, 0, i);
}
output = bos.toByteArray();
} catch (Exception e) {
output = data;
log.error("Errors while zip data.", e);
throw new WecubeCoreException("Failed to zip data:" + e.getMessage());
} finally {
try {
if (bos != null) {
bos.close();
}
} catch (IOException e) {
log.info("errors while closing.", e);
}
}
compresser.end();
return output;
}
private String unzipBytesToString(byte[] byteData) {
byte[] output = new byte[0];
Inflater decompresser = new Inflater();
decompresser.reset();
decompresser.setInput(byteData);
ByteArrayOutputStream o = new ByteArrayOutputStream(byteData.length);
try {
byte[] buf = new byte[1024];
while (!decompresser.finished()) {
int i = decompresser.inflate(buf);
o.write(buf, 0, i);
}
output = o.toByteArray();
} catch (Exception e) {
output = byteData;
log.error("Failed to unzip byte data.", e);
throw new WecubeCoreException("Failed to unzip data:" + e.getMessage());
} finally {
try {
o.close();
} catch (IOException e) {
log.info("errors while closing.", e);
}
}
decompresser.end();
return new String(output, Charset.forName("UTF-8"));
}
private PluginCertificationExportDto convertStringToDto(String content) {
try {
PluginCertificationExportDto dto = objectMapper.readValue(content, PluginCertificationExportDto.class);
return dto;
} catch (Exception e) {
log.error("Failed to read json value.", e);
throw new WecubeCoreException("Failed to import plugin certification:" + e.getMessage());
}
}
private String convertResultToString(PluginCertificationExportDto dto) {
String content = "";
try {
content = objectMapper.writeValueAsString(dto);
} catch (JsonProcessingException e) {
log.error("errors while converting result", e);
throw new WecubeCoreException("3130", "Failed to convert result.");
}
return content;
}
}
......@@ -8,6 +8,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -18,6 +19,7 @@ import com.webank.wecube.platform.core.dto.plugin.CommonResponseDto;
import com.webank.wecube.platform.core.dto.plugin.QueryRequestDto;
import com.webank.wecube.platform.core.dto.plugin.ResourceItemDto;
import com.webank.wecube.platform.core.dto.plugin.ResourceServerDto;
import com.webank.wecube.platform.core.dto.plugin.ResourceServerProductSerialDto;
import com.webank.wecube.platform.core.service.resource.ResourceItemStatus;
import com.webank.wecube.platform.core.service.resource.ResourceItemType;
import com.webank.wecube.platform.core.service.resource.ResourceManagementService;
......@@ -30,6 +32,13 @@ public class ResourceManagementController {
@Autowired
private ResourceManagementService resourceService;
@GetMapping("/servers/{id}/product-serial")
@PreAuthorize("hasAnyAuthority('ADMIN_RESOURCES_MANAGEMENT','SUB_SYSTEM')")
public CommonResponseDto retrieveResourceServerProductSerial(@PathVariable(value = "id") String resourceServerId) {
ResourceServerProductSerialDto dto = resourceService.retrieveResourceServerProductSerial(resourceServerId);
return okayWithData(dto);
}
@PostMapping("/servers/retrieve")
@PreAuthorize("hasAnyAuthority('ADMIN_RESOURCES_MANAGEMENT','SUB_SYSTEM')")
......
......@@ -38,9 +38,11 @@ import com.webank.wecube.platform.core.dto.workflow.ProcDefOutlineDto;
import com.webank.wecube.platform.core.dto.workflow.ProcRoleRequestDto;
import com.webank.wecube.platform.core.dto.workflow.ProcessDataPreviewDto;
import com.webank.wecube.platform.core.dto.workflow.ProcessDeploymentResultDto;
import com.webank.wecube.platform.core.dto.workflow.ProcessDraftResultDto;
import com.webank.wecube.platform.core.dto.workflow.TaskNodeDefBriefDto;
import com.webank.wecube.platform.core.service.workflow.ProcessRoleServiceImpl;
import com.webank.wecube.platform.core.service.workflow.WorkflowDataService;
import com.webank.wecube.platform.core.service.workflow.WorkflowProcDefDeploymentService;
import com.webank.wecube.platform.core.service.workflow.WorkflowProcDefMigrationService;
import com.webank.wecube.platform.core.service.workflow.WorkflowProcDefService;
......@@ -61,18 +63,20 @@ public class WorkflowProcessDefinitionController {
@Autowired
private ProcessRoleServiceImpl processRoleService;
@Autowired
private WorkflowProcDefDeploymentService workflowProcDefDeploymentService;
private ObjectMapper objectMapper = new ObjectMapper();
@PostMapping("/process/definitions/deploy")
public CommonResponseDto deployProcessDefinition(@RequestBody ProcDefInfoDto requestDto,
@RequestParam(value = "continue_token", required = false) String continueToken) {
public CommonResponseDto deployProcessDefinition(@RequestBody ProcDefInfoDto requestDto) {
if (log.isDebugEnabled()) {
log.debug("deploy process:procDefKey={},procDefName={},rootEntity={}, continueToken={}",
requestDto.getProcDefKey(), requestDto.getProcDefName(), requestDto.getRootEntity(), continueToken);
log.debug("deploy process:procDefKey={},procDefName={},rootEntity={}", requestDto.getProcDefKey(),
requestDto.getProcDefName(), requestDto.getRootEntity());
}
// #2222
ProcessDeploymentResultDto resultDto = procDefService.deployProcessDefinition(requestDto, continueToken);
ProcessDeploymentResultDto resultDto = workflowProcDefDeploymentService.deployProcessDefinition(requestDto);
if (resultDto.isConfirm()) {
CommonResponseDto respDto = new CommonResponseDto();
respDto.setStatus(resultDto.getStatus());
......@@ -86,22 +90,35 @@ public class WorkflowProcessDefinitionController {
}
@PostMapping("/process/definitions/draft")
public CommonResponseDto draftProcessDefinition(@RequestBody ProcDefInfoDto requestDto) {
public CommonResponseDto draftProcessDefinition(@RequestBody ProcDefInfoDto requestDto,
@RequestParam(value = "continue_token", required = false) String continueToken) {
if (log.isDebugEnabled()) {
log.debug("draft process:procDefKey={},procDefName={},rootEntity={}", requestDto.getProcDefKey(),
requestDto.getProcDefName(), requestDto.getRootEntity());
}
ProcDefInfoDto result = procDefService.draftProcessDefinition(requestDto);
return CommonResponseDto.okayWithData(result);
ProcessDraftResultDto resultDto = workflowProcDefDeploymentService.draftProcessDefinition(requestDto,
continueToken);
if (resultDto.isConfirm()) {
CommonResponseDto respDto = new CommonResponseDto();
respDto.setStatus(resultDto.getStatus());
respDto.setData(resultDto.getContinueToken());
respDto.setMessage(resultDto.getMessage());
return respDto;
} else {
return CommonResponseDto.okayWithData(resultDto.getResult());
}
}
@GetMapping("/process/definitions")
public CommonResponseDto getProcessDefinitions(
@RequestParam(name = "includeDraft", required = false, defaultValue = "1") int includeDraft,
@RequestParam(name = "permission", required = false, defaultValue = "") String permission) {
@RequestParam(name = "permission", required = false, defaultValue = "") String permission,
@RequestParam(name = "tags", required = false) String tags) {
boolean includeDraftProcDef = (includeDraft == 1);
List<ProcDefInfoDto> result = procDefService.getProcessDefinitions(includeDraftProcDef, permission);
List<ProcDefInfoDto> result = procDefService.getProcessDefinitions(includeDraftProcDef, permission, tags);
return CommonResponseDto.okayWithData(result);
}
......@@ -138,6 +155,15 @@ public class WorkflowProcessDefinitionController {
return CommonResponseDto.okayWithData(result);
}
@GetMapping("/process/definitions/{proc-def-id}/root-context-nodes/briefs")
public CommonResponseDto getRootContextTaskNodes(@PathVariable("proc-def-id") String procDefId,
@RequestParam(name = "taskNodeId", required = true) String taskNodeId,
@RequestParam(name = "prevCtxNodeIds", required = false) String prevCtxNodeIds) {
List<TaskNodeDefBriefDto> result = procDefService.getRootContextTaskNodes( procDefId, taskNodeId, prevCtxNodeIds);
return CommonResponseDto.okayWithData(result);
}
@GetMapping("/process/definitions/{proc-def-id}/tasknodes/briefs")
public CommonResponseDto getTaskNodeBriefs(@PathVariable("proc-def-id") String procDefId) {
List<TaskNodeDefBriefDto> result = procDefService.getTaskNodeBriefs(procDefId);
......
......@@ -7,7 +7,7 @@ public class BatchExecutionRequestDto {
private PluginConfigInterfaceDto pluginConfigInterface;
private String packageName;
private String entityName;
private List<InputParameterDefinition> inputParameterDefinitions;
private List<InputParameterDefinitionDto> inputParameterDefinitions;
private BusinessKeyAttributeDto businessKeyAttribute;
private List<ResourceDataDto> resourceDatas;
......@@ -38,11 +38,11 @@ public class BatchExecutionRequestDto {
this.entityName = entityName;
}
public List<InputParameterDefinition> getInputParameterDefinitions() {
public List<InputParameterDefinitionDto> getInputParameterDefinitions() {
return inputParameterDefinitions;
}
public void setInputParameterDefinitions(List<InputParameterDefinition> inputParameterDefinitions) {
public void setInputParameterDefinitions(List<InputParameterDefinitionDto> inputParameterDefinitions) {
this.inputParameterDefinitions = inputParameterDefinitions;
}
......
......@@ -11,9 +11,9 @@ public class CoreObjectPropertyMetaDto {
private String dataType;
private String refType;
private String multiple;
private String refName;
private String refObjectName;
private String mappingType;
......@@ -57,22 +57,6 @@ public class CoreObjectPropertyMetaDto {
this.dataType = dataType;
}
public String getRefType() {
return refType;
}
public void setRefType(String refType) {
this.refType = refType;
}
public String getRefName() {
return refName;
}
public void setRefName(String refName) {
this.refName = refName;
}
public String getObjectMetaId() {
return objectMetaId;
}
......@@ -145,4 +129,20 @@ public class CoreObjectPropertyMetaDto {
this.configId = configId;
}
public String getMultiple() {
return multiple;
}
public void setMultiple(String multiple) {
this.multiple = multiple;
}
public String getRefObjectName() {
return refObjectName;
}
public void setRefObjectName(String refObjectName) {
this.refObjectName = refObjectName;
}
}
......@@ -10,6 +10,8 @@ public class DynamicEntityAttributeDto {
private String refPackageName;
private String refEntityName;
private String refAttributeName;
private String required;
private String multiple;
public String getId() {
return id;
......@@ -83,4 +85,20 @@ public class DynamicEntityAttributeDto {
this.refAttributeName = refAttributeName;
}
public String getRequired() {
return required;
}
public void setRequired(String required) {
this.required = required;
}
public String getMultiple() {
return multiple;
}
public void setMultiple(String multiple) {
this.multiple = multiple;
}
}
package com.webank.wecube.platform.core.dto.plugin;
public class InputParameterDefinition {
public class InputParameterDefinitionDto {
public static final String DATA_TYPE_STRING = "string";
public static final String DATA_TYPE_NUMBER = "number";
......
package com.webank.wecube.platform.core.dto.plugin;
public class PluginCertificationDto {
private String id;
private String plugin;
private String lpk;
private String encryptData;
private String signature;
private String description;
private String createdTime;
private String createdBy;
private String updatedTime;
private String updatedBy;
public String getPlugin() {
return plugin;
}
public void setPlugin(String plugin) {
this.plugin = plugin;
}
public String getLpk() {
return lpk;
}
public void setLpk(String lpk) {
this.lpk = lpk;
}
public String getEncryptData() {
return encryptData;
}
public void setEncryptData(String encryptData) {
this.encryptData = encryptData;
}
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[id=");
builder.append(id);
builder.append(", plugin=");
builder.append(plugin);
builder.append(", lpk=");
builder.append(lpk);
builder.append(", encryptData=");
builder.append(encryptData);
builder.append(", signature=");
builder.append(signature);
builder.append(", description=");
builder.append(description);
builder.append("]");
return builder.toString();
}
}
package com.webank.wecube.platform.core.dto.plugin;
public class PluginCertificationExportDto {
private String plugin;
private String lpk;
private String data;
private String signature;
private String description;
public String getPlugin() {
return plugin;
}
public void setPlugin(String plugin) {
this.plugin = plugin;
}
public String getLpk() {
return lpk;
}
public void setLpk(String lpk) {
this.lpk = lpk;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[plugin=");
builder.append(plugin);
builder.append(", lpk=");
builder.append(lpk);
builder.append(", data=");
builder.append(data);
builder.append(", signature=");
builder.append(signature);
builder.append(", description=");
builder.append(description);
builder.append("]");
return builder.toString();
}
}
......@@ -17,6 +17,9 @@ public class PluginConfigInterfaceParameterDto {
private String description;
private String mappingValue;
private String multiple;
private String refObjectName;
private CoreObjectMetaDto refObjectMeta;
......@@ -129,4 +132,22 @@ public class PluginConfigInterfaceParameterDto {
this.mappingValue = mappingValue;
}
public String getMultiple() {
return multiple;
}
public void setMultiple(String multiple) {
this.multiple = multiple;
}
public String getRefObjectName() {
return refObjectName;
}
public void setRefObjectName(String refObjectName) {
this.refObjectName = refObjectName;
}
}
......@@ -10,67 +10,9 @@ public class PluginPackageAttributeDto {
private String refPackageName;
private String refEntityName;
private String refAttributeName;
private String mandatory;
private String multiple;
// public PluginPackageAttributeDto(String attributeId,
// String name,
// String description,
// String dataType,
// String referencePackageName,
// String referenceEntityName,
// String referenceAttributeName) {
// this.id = attributeId;
// this.name = name;
// this.description = description;
// this.dataType = dataType;
// this.refPackageName = referencePackageName;
// this.refEntityName = referenceEntityName;
// this.refAttributeName = referenceAttributeName;
// }
// public PluginPackageAttributeDto() {
// }
//
// /**
// * @param attributeDto input attribute dto
// * @param referenceAttribute the attribute this attribute refers to
// * @param referenceEntity the entity this attribute refers to
// * @return transformed attribute domain object
// */
// public static PluginPackageAttributes toDomain(PluginPackageAttributeDto attributeDto,
// PluginPackageAttributes referenceAttribute,
// PluginPackageEntities referenceEntity) {
// PluginPackageAttributes pluginPackageAttribute = new PluginPackageAttributes();
//
//
// if (referenceEntity != null) {
// pluginPackageAttribute.setPluginPackageEntities(referenceEntity);
// }
//
// if (referenceAttribute != null) {
// pluginPackageAttribute.setPluginPackageAttribute(referenceAttribute);
// }
//
// if (attributeDto.getName() != null) {
// pluginPackageAttribute.setName(attributeDto.getName());
// }
//
// if (attributeDto.getDescription() != null) {
// // the description can be empty
// pluginPackageAttribute.setDescription(attributeDto.getDescription());
// }
//
// if (!StringUtils.isEmpty(attributeDto.getDataType())) {
// // the DataType should not be null or empty
// pluginPackageAttribute.setDataType(attributeDto.getDataType().toLowerCase());
// }
//
// return pluginPackageAttribute;
// }
public String getId() {
return id;
......@@ -144,28 +86,20 @@ public class PluginPackageAttributeDto {
this.refAttributeName = refAttributeName;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
// PluginPackageAttributeDto that = (PluginPackageAttributeDto) o;
// return getPackageName().equals(that.getPackageName()) &&
// getEntityName().equals(that.getEntityName()) &&
// getName().equals(that.getName()) &&
// Objects.equals(getDescription(), that.getDescription()) &&
// getDataType().equals(that.getDataType()) &&
// Objects.equals(getRefPackageName(), that.getRefPackageName()) &&
// Objects.equals(getRefEntityName(), that.getRefEntityName()) &&
// Objects.equals(getRefAttributeName(), that.getRefAttributeName());
// }
//
// @Override
// public int hashCode() {
// return Objects.hash(getPackageName(), getEntityName(), getName(), getDescription(), getDataType(), getRefPackageName(), getRefEntityName(), getRefAttributeName());
// }
//
// @Override
// public String toString() {
// return ReflectionToStringBuilder.toString(this);
// }
public String getMandatory() {
return mandatory;
}
public void setMandatory(String mandatory) {
this.mandatory = mandatory;
}
public String getMultiple() {
return multiple;
}
public void setMultiple(String multiple) {
this.multiple = multiple;
}
}
package com.webank.wecube.platform.core.dto.plugin;
public class ResourceServerProductSerialDto {
private String id;
private String productSerial;
private String host;
private String loginUsername;
private String name;
private String port;
private String purpose;
private String status;
public String getProductSerial() {
return productSerial;
}
public void setProductSerial(String productSerial) {
this.productSerial = productSerial;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getLoginUsername() {
return loginUsername;
}
public void setLoginUsername(String loginUsername) {
this.loginUsername = loginUsername;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPort() {
return port;
}
public void setPort(String port) {
this.port = port;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
......@@ -16,6 +16,8 @@ public abstract class BaseProcDefDto {
private String createdTime;
private String excludeMode;
private String tags;
private Map<String, List<String>> permissionToRole;
......@@ -99,4 +101,14 @@ public abstract class BaseProcDefDto {
this.excludeMode = excludeMode;
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags;
}
}
......@@ -21,6 +21,8 @@ public class ProcDefInfoExportImportDto {
private Map<String, List<Long>> permissionToRole;
private List<TaskNodeDefInfoDto> taskNodeInfos = new ArrayList<>();
private String tags;
public String getProcDefId() {
return procDefId;
......@@ -122,4 +124,14 @@ public class ProcDefInfoExportImportDto {
this.excludeMode = excludeMode;
}
public String getTags() {
return tags;
}
public void setTags(String tags) {
this.tags = tags;
}
}
package com.webank.wecube.platform.core.dto.workflow;
public class ProcessDraftResultDto {
public static String STATUS_CONFIRM = "CONFIRM";
public static String STATUS_OK = "OK";
private String status;
private String message;
private ContinueTokenInfoDto continueToken;
private ProcDefInfoDto result;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ProcDefInfoDto getResult() {
return result;
}
public void setResult(ProcDefInfoDto result) {
this.result = result;
}
public boolean isConfirm() {
return STATUS_CONFIRM.equalsIgnoreCase(this.status);
}
public ContinueTokenInfoDto getContinueToken() {
return continueToken;
}
public void setContinueToken(ContinueTokenInfoDto continueToken) {
this.continueToken = continueToken;
}
}
......@@ -3,7 +3,7 @@ package com.webank.wecube.platform.core.dto.workflow;
import java.util.ArrayList;
import java.util.List;
public class TaskNodeDefInfoDto extends BaseNodeDefDto{
public class TaskNodeDefInfoDto extends BaseNodeDefDto {
private String nodeDefId;
private String procDefKey;
private String procDefId;
......@@ -19,15 +19,18 @@ public class TaskNodeDefInfoDto extends BaseNodeDefDto{
private String timeoutExpression;
private String status;
private String orderedNo;
private String taskCategory; //SUTN-user task,SSTN-service task,SDTN-data operation task
private String taskCategory; // SUTN-user task,SSTN-service task,SDTN-data
// operation task
private String preCheck;
private String dynamicBind;
private String prevCtxNodeIds = "";
private List<TaskNodeDefParamDto> paramInfos = new ArrayList<>();
public String getNodeDefId() {
......@@ -109,7 +112,7 @@ public class TaskNodeDefInfoDto extends BaseNodeDefDto{
public void setStatus(String status) {
this.status = status;
}
public String getTaskCategory() {
return taskCategory;
}
......@@ -126,17 +129,15 @@ public class TaskNodeDefInfoDto extends BaseNodeDefDto{
this.paramInfos = paramInfos;
}
public void addParamInfos(TaskNodeDefParamDto...paramInfos){
for(TaskNodeDefParamDto d : paramInfos){
if(d == null){
public void addParamInfos(TaskNodeDefParamDto... paramInfos) {
for (TaskNodeDefParamDto d : paramInfos) {
if (d == null) {
continue;
}
this.paramInfos.add(d);
}
}
public String getOrderedNo() {
return orderedNo;
......@@ -145,9 +146,7 @@ public class TaskNodeDefInfoDto extends BaseNodeDefDto{
public void setOrderedNo(String orderedNo) {
this.orderedNo = orderedNo;
}
@Override
public String toString() {
return "TaskNodeDefInfoDto [nodeDefId=" + nodeDefId + ", processDefKey=" + procDefKey + ", processDefId="
......@@ -172,4 +171,13 @@ public class TaskNodeDefInfoDto extends BaseNodeDefDto{
public void setDynamicBind(String dynamicBind) {
this.dynamicBind = dynamicBind;
}
public String getPrevCtxNodeIds() {
return prevCtxNodeIds;
}
public void setPrevCtxNodeIds(String prevCtxNodeIds) {
this.prevCtxNodeIds = prevCtxNodeIds;
}
}
......@@ -13,9 +13,9 @@ public class CoreObjectPropertyMeta {
private String dataType;
private String refType;
private String multiple;
private String refName;
private String refObjectName;
private String mapType;
......@@ -71,14 +71,6 @@ public class CoreObjectPropertyMeta {
this.dataType = dataType == null ? null : dataType.trim();
}
public String getRefType() {
return refType;
}
public void setRefType(String refType) {
this.refType = refType == null ? null : refType.trim();
}
public String getMapType() {
return mapType;
}
......@@ -167,14 +159,6 @@ public class CoreObjectPropertyMeta {
this.sensitive = sensitive;
}
public String getRefName() {
return refName;
}
public void setRefName(String refName) {
this.refName = refName;
}
public CoreObjectMeta getObjectMeta() {
return objectMeta;
}
......@@ -219,6 +203,26 @@ public class CoreObjectPropertyMeta {
this.configId = configId;
}
public String getMultiple() {
return multiple;
}
public void setMultiple(String multiple) {
this.multiple = multiple;
}
public String getRefObjectName() {
return refObjectName;
}
public void setRefObjectName(String refObjectName) {
this.refObjectName = refObjectName;
}
public boolean isMultipleData(){
return Constants.DATA_MULTIPLE.equalsIgnoreCase(multiple);
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
......@@ -228,10 +232,10 @@ public class CoreObjectPropertyMeta {
builder.append(name);
builder.append(", dataType=");
builder.append(dataType);
builder.append(", refType=");
builder.append(refType);
builder.append(", refName=");
builder.append(refName);
builder.append(", multiple=");
builder.append(multiple);
builder.append(", refObjectName=");
builder.append(refObjectName);
builder.append(", mapType=");
builder.append(mapType);
builder.append(", mapExpr=");
......@@ -244,14 +248,6 @@ public class CoreObjectPropertyMeta {
builder.append(packageName);
builder.append(", source=");
builder.append(source);
builder.append(", createdBy=");
builder.append(createdBy);
builder.append(", createdTime=");
builder.append(createdTime);
builder.append(", updatedBy=");
builder.append(updatedBy);
builder.append(", updatedTime=");
builder.append(updatedTime);
builder.append(", sensitive=");
builder.append(sensitive);
builder.append(", configId=");
......@@ -259,7 +255,5 @@ public class CoreObjectPropertyMeta {
builder.append("]");
return builder.toString();
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment