@Override
    @Transactional(rollbackFor = Exception.class)
    public ConfigImportResult importData(final List<PluginDTO> pluginList, final ConfigsImportContext context) {
        if (CollectionUtils.isEmpty(pluginList)) {
            return ConfigImportResult.success();
        }
        Map<String, PluginDO> existPluginMap = pluginMapper.selectAll()
                .stream()
                .filter(Objects::nonNull)
                .collect(Collectors.toMap(PluginDO::getName, x -> x));
        StringBuilder errorMsgBuilder = new StringBuilder();
        int successCount = 0;
        for (PluginDTO pluginDTO : pluginList) {
            String pluginName = pluginDTO.getName();
            // check plugin base info
            if (existPluginMap.containsKey(pluginName)) {
                errorMsgBuilder
                        .append(pluginName)
                        .append(",");
                Optional.ofNullable(context).ifPresent(c -> c.getPluginTemplateIdMapping().put(pluginDTO.getId(), existPluginMap.get(pluginName).getId()));
            } else {
                String pluginId = UUIDUtils.getInstance().generateShortUuid();
                Optional.ofNullable(context).ifPresent(c -> c.getPluginTemplateIdMapping().put(pluginDTO.getId(), pluginId));
                pluginDTO.setId(pluginId);
                PluginDO pluginDO = PluginDO.buildPluginDO(pluginDTO);
                if (pluginMapper.insertSelective(pluginDO) > 0) {
                    // publish create event. init plugin data
                    successCount++;
                }
            }
        }
        if (StringUtils.isNotEmpty(errorMsgBuilder)) {
            errorMsgBuilder.setLength(errorMsgBuilder.length() - 1);
            return ConfigImportResult
                    .fail(successCount, "import fail plugin: " + errorMsgBuilder);
        }
        return ConfigImportResult.success(successCount);
    }
activate plugin snapshot.

@return List of plugins snapshot
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/PluginServiceImpl.java