@Override
    public ConfigImportResult importData(final String namespace, final List<DiscoveryUpstreamDTO> discoveryUpstreamList, final ConfigsImportContext context) {
        if (CollectionUtils.isEmpty(discoveryUpstreamList)) {
            return ConfigImportResult.success();
        }
        Map<String, String> discoveryHandlerIdMapping = context.getDiscoveryHandlerIdMapping();
        int successCount = 0;
        StringBuilder errorMsgBuilder = new StringBuilder();
        Map<String, List<DiscoveryUpstreamDO>> discoveryHandlerUpstreamMap = discoveryUpstreamMapper
                .selectByNamespaceId(namespace)
                .stream()
                .collect(Collectors.groupingBy(DiscoveryUpstreamDO::getDiscoveryHandlerId));
        for (DiscoveryUpstreamDTO discoveryUpstreamDTO : discoveryUpstreamList) {
            String discoveryHandlerId = discoveryUpstreamDTO.getDiscoveryHandlerId();
            String url = discoveryUpstreamDTO.getUrl();
            Set<String> existsUpstreamUrlSet = discoveryHandlerUpstreamMap
                    .getOrDefault(discoveryHandlerId, Lists.newArrayList())
                    .stream()
                    .map(DiscoveryUpstreamDO::getUrl)
                    .collect(Collectors.toSet());
            if (existsUpstreamUrlSet.contains(url)) {
                errorMsgBuilder
                        .append(url)
                        .append(",");
                continue;
            }
            discoveryUpstreamDTO.setNamespaceId(namespace);
            discoveryUpstreamDTO.setId(null);
            discoveryUpstreamDTO.setDiscoveryHandlerId(discoveryHandlerIdMapping.get(discoveryUpstreamDTO.getDiscoveryHandlerId()));
            DiscoveryUpstreamDO discoveryUpstreamDO = DiscoveryUpstreamDO.buildDiscoveryUpstreamDO(discoveryUpstreamDTO);
            discoveryUpstreamMapper.insert(discoveryUpstreamDO);
            successCount++;
        }
        if (StringUtils.hasLength(errorMsgBuilder)) {
            errorMsgBuilder.setLength(errorMsgBuilder.length() - 1);
            return ConfigImportResult
                    .fail(successCount, "import fail discovery upstream: " + errorMsgBuilder);
        }
        return ConfigImportResult.success(successCount);
    }
update.

@param discoveryUpstreamDTO discoveryUpstreamDTO
@return the string
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/DiscoveryUpstreamServiceImpl.java