private void removeRegister(final ApiDO apiDO) {
        final String path = apiDO.getApiPath();
        RuleQueryCondition condition = new RuleQueryCondition();
        condition.setKeyword(path);
        //clean rule
        final List<RuleVO> rules = ruleService.searchByCondition(condition);
        if (CollectionUtils.isNotEmpty(rules)) {
            ruleService.deleteByIdsAndNamespaceId(rules.stream()
                    .map(RuleVO::getId)
                    .distinct()
                    // todo:[To be refactored with namespace]  Temporarily  hardcode
                    .collect(Collectors.toList()), SYS_DEFAULT_NAMESPACE_ID);
        }
        //clean selector
        List<SelectorDO> selectorDOList = selectorService.findByNameAndPluginNamesAndNamespaceId(apiDO.getContextPath(), PluginEnum.getUpstreamNames(), SYS_DEFAULT_NAMESPACE_ID);
        ArrayList<String> selectorIds = Lists.newArrayList();
        Optional.ofNullable(selectorDOList).orElseGet(ArrayList::new).stream().forEach(selectorDO -> {
            final String selectorId = selectorDO.getId();
            final List<RuleData> data = ruleService.findBySelectorId(selectorId);
            if (CollectionUtils.isEmpty(data)) {
                selectorIds.add(selectorId);
            }
        });
        if (CollectionUtils.isNotEmpty(selectorIds)) {
            // todo:[To be refactored with namespace]  Temporarily  hardcode
            selectorService.deleteByNamespaceId(selectorIds, SYS_DEFAULT_NAMESPACE_ID);
        }
        //clean metadata
        Optional.ofNullable(metaDataService.findByPathAndNamespaceId(path, SYS_DEFAULT_NAMESPACE_ID))
                .ifPresent(metaDataDO -> metaDataService.deleteByIdsAndNamespaceId(Lists.newArrayList(metaDataDO.getId()), SYS_DEFAULT_NAMESPACE_ID));
    }
create.

@param apiDTO apiDTO
@return create message
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/ApiServiceImpl.java