@Override
    @Transactional(rollbackFor = Exception.class)
    public ConfigImportResult importData(final List<RuleDTO> ruleList) {
        if (CollectionUtils.isEmpty(ruleList)) {
            return ConfigImportResult.success();
        }

        Map<String, List<RuleDO>> selectorRuleMap = ruleMapper
                .selectAll()
                .stream()
                .collect(Collectors.groupingBy(RuleDO::getSelectorId));

        int successCount = 0;
        StringBuilder errorMsgBuilder = new StringBuilder();
        for (RuleDTO ruleDTO : ruleList) {
            String selectorId = ruleDTO.getSelectorId();
            String ruleName = ruleDTO.getName();
            Set<String> existRuleNameSet = selectorRuleMap
                    .getOrDefault(selectorId, Lists.newArrayList())
                    .stream()
                    .map(RuleDO::getName)
                    .collect(Collectors.toSet());

            if (existRuleNameSet.contains(ruleName)) {
                errorMsgBuilder
                        .append(ruleName)
                        .append(",");
                continue;
            }
            RuleDO ruleDO = RuleDO.buildRuleDO(ruleDTO);
            final int ruleCount = ruleMapper.insertSelective(ruleDO);
            addCondition(ruleDO, ruleDTO.getRuleConditions());
            if (ruleCount > 0) {
                successCount++;
            }
        }
        if (StringUtils.isNotEmpty(errorMsgBuilder)) {
            errorMsgBuilder.setLength(errorMsgBuilder.length() - 1);
            return ConfigImportResult
                    .fail(successCount, "import fail rule: " + errorMsgBuilder);
        }
        return ConfigImportResult.success(successCount);
    }
find page of rule by query.

@param ruleQuery {@linkplain RuleQuery}
@return {@linkplain CommonPager}
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/RuleServiceImpl.java