From 59c7291a896d96eb1192cab785ad361fcdbe3bfe Mon Sep 17 00:00:00 2001 From: rchen9 Date: Thu, 14 Nov 2024 16:18:51 +0800 Subject: [PATCH] feat: add the logic about ScriptContent --- ...omparisonScriptConfigurableController.java | 32 +++++++++++ .../src/main/resources/application.yaml | 1 + .../business/SystemConfigurationService.java | 34 +++++++++++- .../ComparisonScriptConfigurableHandler.java | 1 - .../ComparisonScriptContentHandler.java | 31 +++++++++++ .../replay/ComparisonSummaryService.java | 40 +++++++++++++- .../ComparisonScriptContentRepository.java | 55 +++++++++++++++++++ .../config/SystemConfigWithProperties.java | 11 ++++ .../ComparisonScriptContentRequestType.java | 14 +++++ .../ComparisonSummaryConfiguration.java | 5 ++ .../ComparisonScriptContentCollection.java | 22 ++++++++ .../dto/config/ComparisonScriptContent.java | 13 +++++ .../ConfigComparisonScriptContentMapper.java | 26 +++++++++ pom.xml | 2 +- 14 files changed, 281 insertions(+), 6 deletions(-) create mode 100644 arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptContentHandler.java create mode 100644 arex-web-core/src/main/java/com/arextest/web/core/repository/mongo/ComparisonScriptContentRepository.java create mode 100644 arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonScriptContentRequestType.java create mode 100644 arex-web-model/src/main/java/com/arextest/web/model/dao/mongodb/ComparisonScriptContentCollection.java create mode 100644 arex-web-model/src/main/java/com/arextest/web/model/dto/config/ComparisonScriptContent.java create mode 100644 arex-web-model/src/main/java/com/arextest/web/model/mapper/ConfigComparisonScriptContentMapper.java diff --git a/arex-web-api/src/main/java/com/arextest/web/api/service/controller/config/ComparisonScriptConfigurableController.java b/arex-web-api/src/main/java/com/arextest/web/api/service/controller/config/ComparisonScriptConfigurableController.java index 7d23953f..7dbf52bf 100644 --- a/arex-web-api/src/main/java/com/arextest/web/api/service/controller/config/ComparisonScriptConfigurableController.java +++ b/arex-web-api/src/main/java/com/arextest/web/api/service/controller/config/ComparisonScriptConfigurableController.java @@ -4,13 +4,16 @@ import com.arextest.common.utils.ResponseUtils; import com.arextest.web.core.business.config.ConfigurableHandler; import com.arextest.web.core.business.config.replay.ComparisonScriptConfigurableHandler; +import com.arextest.web.core.business.config.replay.ComparisonScriptContentHandler; import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptConfiguration; +import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptContentRequestType; import com.arextest.web.model.contract.contracts.config.replay.PageQueryComparisonRequestType; import com.arextest.web.model.contract.contracts.config.replay.QueryComparisonRequestType; import jakarta.annotation.Resource; import java.util.List; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,6 +28,9 @@ public class ComparisonScriptConfigurableController extends @Resource ComparisonScriptConfigurableHandler scriptConfigurableHandler; + @Resource + ComparisonScriptContentHandler scriptContentHandler; + protected ComparisonScriptConfigurableController( ConfigurableHandler configurableHandler) { super(configurableHandler); @@ -67,5 +73,31 @@ public Response pageQueryComparisonConfig(@RequestBody PageQueryComparisonReques ); } + @GetMapping("/queryAllScriptMethod") + @ResponseBody + public Response queryAllScriptMethod() { + return ResponseUtils.successResponse( + scriptContentHandler.queryAllScriptMethodNames() + ); + } + + + @PostMapping("/saveScriptContent") + @ResponseBody + public Response saveScriptContent( + @RequestBody ComparisonScriptContentRequestType scriptContentRequestType) { + return ResponseUtils.successResponse( + scriptContentHandler.saveScriptContent(scriptContentRequestType) + ); + } + + @GetMapping("/queryAllScriptContent") + @ResponseBody + public Response queryAllScriptContent() { + return ResponseUtils.successResponse( + scriptContentHandler.queryAll() + ); + } + } diff --git a/arex-web-api/src/main/resources/application.yaml b/arex-web-api/src/main/resources/application.yaml index e9462dff..7ed44195 100644 --- a/arex-web-api/src/main/resources/application.yaml +++ b/arex-web-api/src/main/resources/application.yaml @@ -46,6 +46,7 @@ arex: uuidIgnore: true ipIgnore: true ignoreNodeSet: "" + scriptTemplate: "function func_%s(context, baseValue, testValue, arg) {%s}" # arex sending email domain email: domain: https://mail.arextest.com diff --git a/arex-web-core/src/main/java/com/arextest/web/core/business/SystemConfigurationService.java b/arex-web-core/src/main/java/com/arextest/web/core/business/SystemConfigurationService.java index baed1b2f..4c0126ee 100644 --- a/arex-web-core/src/main/java/com/arextest/web/core/business/SystemConfigurationService.java +++ b/arex-web-core/src/main/java/com/arextest/web/core/business/SystemConfigurationService.java @@ -7,17 +7,22 @@ import com.arextest.config.model.dto.system.SystemConfiguration; import com.arextest.config.repository.SystemConfigurationRepository; import com.arextest.diff.service.DecompressService; +import com.arextest.web.core.business.config.replay.ComparisonScriptContentHandler; import com.arextest.web.model.contract.contracts.config.SystemConfigWithProperties; +import com.arextest.web.model.contract.contracts.config.SystemConfigWithProperties.ScriptContentInfo; +import com.arextest.web.model.dto.config.ComparisonScriptContent; +import jakarta.annotation.Resource; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; /** @@ -34,6 +39,12 @@ public class SystemConfigurationService { @Resource private ConfigLoadService configLoadService; + @Resource + private ComparisonScriptContentHandler comparisonScriptContentHandler; + + @Value("${arex.compare.scriptTemplate}") + private String compareTemplate; + public boolean saveConfig(SystemConfiguration systemConfiguration) { List systemConfigurations = new ArrayList<>(); List removeKeys = new ArrayList<>(); @@ -55,7 +66,8 @@ public boolean saveConfig(SystemConfiguration systemConfiguration) { removeKeys.add(SystemConfigurationCollection.KeySummary.DESERIALIZATION_JAR); } if (systemConfiguration.getComparePluginInfo() != null - && StringUtils.isNotBlank(systemConfiguration.getComparePluginInfo().getComparePluginUrl())) { + && StringUtils.isNotBlank( + systemConfiguration.getComparePluginInfo().getComparePluginUrl())) { SystemConfiguration comparePluginInfoConfig = new SystemConfiguration(); ComparePluginInfo comparePluginInfo = systemConfiguration.getComparePluginInfo(); comparePluginInfo.setTransMethodList(identifyTransformMethod(comparePluginInfo)); @@ -152,6 +164,24 @@ private SystemConfigWithProperties appendGlobalCompareConfig(ConfigLoadService c } catch (RuntimeException e) { LOGGER.error("getCompareIgnoredTimePrecisionMillis error", e); } + + List comparisonScriptContents = comparisonScriptContentHandler.queryAll(); + if (CollectionUtils.isNotEmpty(comparisonScriptContents)) { + List scriptContentInfos = new ArrayList<>(); + for (ComparisonScriptContent item : comparisonScriptContents) { + ScriptContentInfo scriptContentInfo = new ScriptContentInfo(); + scriptContentInfo.setAliasName(item.getAliasName()); + + String funcName = item.getId(); + scriptContentInfo.setFunctionName("func_" + funcName); + + String scriptContent = item.getContent(); + scriptContentInfo.setScriptContent(String.format(compareTemplate, funcName, scriptContent)); + scriptContentInfos.add(scriptContentInfo); + } + systemConfigWithProperties.setScriptContentInfos(scriptContentInfos); + } + return systemConfigWithProperties; } } diff --git a/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptConfigurableHandler.java b/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptConfigurableHandler.java index a26c6952..fea20fa0 100644 --- a/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptConfigurableHandler.java +++ b/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptConfigurableHandler.java @@ -106,5 +106,4 @@ private List contractFromDto( } return result; } - } diff --git a/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptContentHandler.java b/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptContentHandler.java new file mode 100644 index 00000000..cb749db9 --- /dev/null +++ b/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonScriptContentHandler.java @@ -0,0 +1,31 @@ +package com.arextest.web.core.business.config.replay; + +import com.arextest.web.core.repository.mongo.ComparisonScriptContentRepository; +import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptContentRequestType; +import com.arextest.web.model.dto.config.ComparisonScriptContent; +import com.arextest.web.model.mapper.ConfigComparisonScriptContentMapper; +import java.util.List; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +@RequiredArgsConstructor +@Component +public class ComparisonScriptContentHandler { + + + private final ComparisonScriptContentRepository comparisonScriptContentRepository; + + public List queryAllScriptMethodNames() { + return comparisonScriptContentRepository.queryAllScriptMethodNames(); + } + + public boolean saveScriptContent(ComparisonScriptContentRequestType request) { + ComparisonScriptContent dto = + ConfigComparisonScriptContentMapper.INSTANCE.dtoFromContract(request); + return comparisonScriptContentRepository.save(dto); + } + + public List queryAll() { + return comparisonScriptContentRepository.queryAll(); + } +} diff --git a/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonSummaryService.java b/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonSummaryService.java index eec24afc..1e5ff128 100644 --- a/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonSummaryService.java +++ b/arex-web-core/src/main/java/com/arextest/web/core/business/config/replay/ComparisonSummaryService.java @@ -9,7 +9,6 @@ import com.arextest.web.core.business.config.ConfigurableHandler; import com.arextest.web.core.business.config.application.ApplicationOperationConfigurableHandler; import com.arextest.web.core.repository.AppContractRepository; -import com.arextest.web.model.contract.contracts.common.enums.ExpirationType; import com.arextest.web.model.contract.contracts.compare.CategoryDetail; import com.arextest.web.model.contract.contracts.compare.TransformDetail; import com.arextest.web.model.contract.contracts.config.replay.AbstractComparisonDetailsConfiguration; @@ -19,6 +18,8 @@ import com.arextest.web.model.contract.contracts.config.replay.ComparisonInclusionsConfiguration; import com.arextest.web.model.contract.contracts.config.replay.ComparisonListSortConfiguration; import com.arextest.web.model.contract.contracts.config.replay.ComparisonReferenceConfiguration; +import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptConfiguration; +import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptConfiguration.ScriptMethod; import com.arextest.web.model.contract.contracts.config.replay.ComparisonSummaryConfiguration; import com.arextest.web.model.contract.contracts.config.replay.ComparisonTransformConfiguration; import com.arextest.web.model.contract.contracts.config.replay.QueryConfigOfCategoryRequestType; @@ -30,6 +31,7 @@ import com.arextest.web.model.dto.AppContractDto; import com.arextest.web.model.enums.ContractTypeEnum; import com.google.common.collect.ImmutableMap; +import jakarta.annotation.Resource; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -44,7 +46,6 @@ import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; -import jakarta.annotation.Resource; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -76,6 +77,9 @@ public class ComparisonSummaryService { @Resource ConfigLoadService configLoadService; + @Resource + ComparisonScriptConfigurableHandler comparisonScriptConfigurableHandler; + public ComparisonSummaryService( @Autowired ComparisonExclusionsConfigurableHandler exclusionsConfigurableHandler, @Autowired ComparisonInclusionsConfigurableHandler inclusionsConfigurableHandler, @@ -105,6 +109,7 @@ public ComparisonSummaryConfiguration getComparisonDetailsSummary(String interfa getComparisonInclusionsConfiguration(interfaceId, comparisonSummaryConfiguration); getComparisonListSortConfiguration(interfaceId, comparisonSummaryConfiguration); getComparisonReferenceConfiguration(interfaceId, comparisonSummaryConfiguration); + getComparisonScriptConfiguration(interfaceId, comparisonSummaryConfiguration); getAdditionalComparisonConfiguration(interfaceId, comparisonSummaryConfiguration); return comparisonSummaryConfiguration; } @@ -260,6 +265,22 @@ protected void getComparisonReferenceConfiguration(String interfaceId, comparisonSummaryConfiguration.setReferenceMap(referenceMap); } + protected void getComparisonScriptConfiguration(String interfaceId, + ComparisonSummaryConfiguration comparisonSummaryConfiguration) { + Map, ScriptMethod> scriptMethodMap = new HashMap<>(); + List comparisonScriptConfigurationList = + comparisonScriptConfigurableHandler.queryByInterfaceId(interfaceId); + comparisonScriptConfigurableHandler.removeDetailsExpired( + comparisonScriptConfigurationList, true); + Optional.ofNullable(comparisonScriptConfigurationList).orElse(Collections.emptyList()) + .forEach(item -> { + if (CollectionUtils.isNotEmpty(item.getNodePath())) { + scriptMethodMap.put(item.getNodePath(), item.getScriptMethod()); + } + }); + comparisonSummaryConfiguration.setScriptMethodMap(scriptMethodMap); + } + protected void getAdditionalComparisonConfiguration(String interfaceId, ComparisonSummaryConfiguration comparisonSummaryConfiguration) { } @@ -339,6 +360,7 @@ protected Map buildMultiConfig })); summaryConfiguration.setReferenceMap(operationReferenceMap); }, operationInfoMap, appContractDtoMap); + buildComparisonConfig(replayConfigurationMap, transformConfigurableHandler.useResultAsList(appId), (configurations, summaryConfiguration) -> { @@ -348,6 +370,20 @@ protected Map buildMultiConfig summaryConfiguration.setTransformDetails(transformDetails); }, operationInfoMap, appContractDtoMap); + buildComparisonConfig(replayConfigurationMap, + comparisonScriptConfigurableHandler.useResultAsList(appId), + (configurations, summaryConfiguration) -> { + Map, ScriptMethod> scriptMethodMap = configurations.stream() + .filter(item -> CollectionUtils.isNotEmpty(item.getNodePath())) + .collect(Collectors.toMap(ComparisonScriptConfiguration::getNodePath, + ComparisonScriptConfiguration::getScriptMethod, (r1, r2) -> { + LogUtils.warn(LOGGER, "scriptMethod duplicate key", + ImmutableMap.of("appId", appId)); + return r2; + })); + summaryConfiguration.setScriptMethodMap(scriptMethodMap); + }, operationInfoMap, appContractDtoMap); + return replayConfigurationMap; } diff --git a/arex-web-core/src/main/java/com/arextest/web/core/repository/mongo/ComparisonScriptContentRepository.java b/arex-web-core/src/main/java/com/arextest/web/core/repository/mongo/ComparisonScriptContentRepository.java new file mode 100644 index 00000000..68e7c9bd --- /dev/null +++ b/arex-web-core/src/main/java/com/arextest/web/core/repository/mongo/ComparisonScriptContentRepository.java @@ -0,0 +1,55 @@ +package com.arextest.web.core.repository.mongo; + +import com.arextest.web.model.dao.mongodb.ComparisonScriptContentCollection; +import com.arextest.web.model.dto.config.ComparisonScriptContent; +import com.arextest.web.model.mapper.ConfigComparisonScriptContentMapper; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.data.mongodb.core.query.Query; +import org.springframework.stereotype.Repository; + +@RequiredArgsConstructor +@Repository +public class ComparisonScriptContentRepository { + + private final MongoTemplate mongoTemplate; + + + public List queryAllScriptMethodNames() { + Query query = new Query(); + query.fields().include(ComparisonScriptContentCollection.Fields.aliasName); + List daos = mongoTemplate.find(query, + ComparisonScriptContentCollection.class); + + if (CollectionUtils.isNotEmpty(daos)) { + return daos.stream() + .map(ComparisonScriptContentCollection::getAliasName) + .collect(Collectors.toList()); + } + return Collections.emptyList(); + } + + public boolean save(ComparisonScriptContent dto) { + ComparisonScriptContentCollection dao = + ConfigComparisonScriptContentMapper.INSTANCE.daoFromDto(dto); + mongoTemplate.save(dao); + return true; + } + + public List queryAll() { + List daos = mongoTemplate.findAll( + ComparisonScriptContentCollection.class); + + if (CollectionUtils.isNotEmpty(daos)) { + return daos.stream() + .map(ConfigComparisonScriptContentMapper.INSTANCE::dtoFromDao) + .collect(Collectors.toList()); + } + return Collections.emptyList(); + } + +} diff --git a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/SystemConfigWithProperties.java b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/SystemConfigWithProperties.java index b69818aa..33eaff0a 100644 --- a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/SystemConfigWithProperties.java +++ b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/SystemConfigWithProperties.java @@ -1,6 +1,7 @@ package com.arextest.web.model.contract.contracts.config; import com.arextest.config.model.dto.system.SystemConfiguration; +import java.util.List; import java.util.Set; import lombok.Data; import lombok.ToString; @@ -50,4 +51,14 @@ public class SystemConfigWithProperties extends SystemConfiguration { * ignore the compare of uuid */ private Boolean ipIgnore; + + private List scriptContentInfos; + + @Data + public static class ScriptContentInfo { + + private String aliasName; + private String functionName; + private String scriptContent; + } } diff --git a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonScriptContentRequestType.java b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonScriptContentRequestType.java new file mode 100644 index 00000000..2180c178 --- /dev/null +++ b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonScriptContentRequestType.java @@ -0,0 +1,14 @@ +package com.arextest.web.model.contract.contracts.config.replay; + +import lombok.Data; + +@Data +public class ComparisonScriptContentRequestType { + + private String id; + + private String aliasName; + + private String content; + +} diff --git a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonSummaryConfiguration.java b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonSummaryConfiguration.java index a9afc2e5..8fcf56a4 100644 --- a/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonSummaryConfiguration.java +++ b/arex-web-model-contract/src/main/java/com/arextest/web/model/contract/contracts/config/replay/ComparisonSummaryConfiguration.java @@ -2,6 +2,7 @@ import com.arextest.web.model.contract.contracts.compare.CategoryDetail; import com.arextest.web.model.contract.contracts.compare.TransformDetail; +import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptConfiguration.ScriptMethod; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; @@ -64,6 +65,10 @@ public class ComparisonSummaryConfiguration { private List transformDetails; + @JsonDeserialize(keyUsing = MapKeyDeserializerUtils.class) + @JsonSerialize(keyUsing = MapKeySerializerUtils.class) + private Map, ScriptMethod> scriptMethodMap; + private Map additionalConfig; private static class MapKeyDeserializerUtils extends KeyDeserializer { diff --git a/arex-web-model/src/main/java/com/arextest/web/model/dao/mongodb/ComparisonScriptContentCollection.java b/arex-web-model/src/main/java/com/arextest/web/model/dao/mongodb/ComparisonScriptContentCollection.java new file mode 100644 index 00000000..763f5757 --- /dev/null +++ b/arex-web-model/src/main/java/com/arextest/web/model/dao/mongodb/ComparisonScriptContentCollection.java @@ -0,0 +1,22 @@ +package com.arextest.web.model.dao.mongodb; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.FieldNameConstants; +import org.springframework.data.mongodb.core.mapping.Document; + +@Data +@NoArgsConstructor +@FieldNameConstants +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Document(collection = "ComparisonScriptContent") +public class ComparisonScriptContentCollection extends ModelBase { + + private String aliasName; + + private String content; + +} diff --git a/arex-web-model/src/main/java/com/arextest/web/model/dto/config/ComparisonScriptContent.java b/arex-web-model/src/main/java/com/arextest/web/model/dto/config/ComparisonScriptContent.java new file mode 100644 index 00000000..376cdab5 --- /dev/null +++ b/arex-web-model/src/main/java/com/arextest/web/model/dto/config/ComparisonScriptContent.java @@ -0,0 +1,13 @@ +package com.arextest.web.model.dto.config; + +import com.arextest.web.model.dto.BaseDto; +import lombok.Data; + +@Data +public class ComparisonScriptContent extends BaseDto { + + private String aliasName; + + private String content; + +} diff --git a/arex-web-model/src/main/java/com/arextest/web/model/mapper/ConfigComparisonScriptContentMapper.java b/arex-web-model/src/main/java/com/arextest/web/model/mapper/ConfigComparisonScriptContentMapper.java new file mode 100644 index 00000000..13d0517b --- /dev/null +++ b/arex-web-model/src/main/java/com/arextest/web/model/mapper/ConfigComparisonScriptContentMapper.java @@ -0,0 +1,26 @@ +package com.arextest.web.model.mapper; + +import com.arextest.web.model.contract.contracts.config.replay.ComparisonScriptContentRequestType; +import com.arextest.web.model.dao.mongodb.ComparisonScriptContentCollection; +import com.arextest.web.model.dto.config.ComparisonScriptContent; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.Mappings; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface ConfigComparisonScriptContentMapper { + + ConfigComparisonScriptContentMapper INSTANCE = Mappers.getMapper( + ConfigComparisonScriptContentMapper.class); + + ComparisonScriptContent dtoFromContract(ComparisonScriptContentRequestType contract); + + @Mappings({ + @Mapping(target = "dataChangeCreateTime", expression = "java(System.currentTimeMillis())"), + @Mapping(target = "dataChangeUpdateTime", expression = "java(System.currentTimeMillis())")}) + ComparisonScriptContentCollection daoFromDto(ComparisonScriptContent dto); + + ComparisonScriptContent dtoFromDao(ComparisonScriptContentCollection dao); + +} diff --git a/pom.xml b/pom.xml index 954b15aa..f7c06a3a 100644 --- a/pom.xml +++ b/pom.xml @@ -490,7 +490,7 @@ - 0.7.0.0 + 0.7.0.1 1.0.1 0.0.1 2.0.2