apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ItemService.java/ItemService/revokeItem
class ItemService:  public void revokeItem(String appId, Env env, String clusterName, String namespaceName) {

    NamespaceDTO namespace = namespaceAPI.loadNamespace(appId, env, clusterName, namespaceName);
    if (namespace == null) {
      throw new BadRequestException(
          "namespace:" + namespaceName + " not exist in env:" + env + ", cluster:" + clusterName);
    }
    long namespaceId = namespace.getId();

    Map<String, String> releaseItemDTOs = new HashMap<>();
    ReleaseDTO latestRelease = releaseAPI.loadLatestRelease(appId,env,clusterName,namespaceName);
    if (latestRelease != null) {
      releaseItemDTOs = GSON.fromJson(latestRelease.getConfigurations(), GsonType.CONFIG);
    }
    List<ItemDTO> baseItems = itemAPI.findItems(appId, env, clusterName, namespaceName);
    Map<String, ItemDTO> oldKeyMapItem = BeanUtils.mapByKey("key", baseItems);
    Map<String, ItemDTO> deletedItemDTOs = new HashMap<>();

    //deleted items for comment
    findDeletedItems(appId, env, clusterName, namespaceName).forEach(item -> {
      deletedItemDTOs.put(item.getKey(),item);
    });

    ItemChangeSets changeSets = new ItemChangeSets();
    AtomicInteger lineNum = new AtomicInteger(1);
    releaseItemDTOs.forEach((key,value) -> {
      ItemDTO oldItem = oldKeyMapItem.get(key);
      if (oldItem == null) {
        ItemDTO deletedItemDto = deletedItemDTOs.computeIfAbsent(key, k -> new ItemDTO());
        changeSets.addCreateItem(buildNormalItem(0L, namespaceId,key,value,deletedItemDto.getComment(),lineNum.get()));
      } else if (!oldItem.getValue().equals(value) || lineNum.get() != oldItem
          .getLineNum()) {
        changeSets.addUpdateItem(buildNormalItem(oldItem.getId(), namespaceId, key,
            value, oldItem.getComment(), lineNum.get()));
      }
      oldKeyMapItem.remove(key);
      lineNum.set(lineNum.get() + 1);
    });
    oldKeyMapItem.forEach((key, value) -> changeSets.addDeleteItem(oldKeyMapItem.get(key)));
    changeSets.setDataChangeLastModifiedBy(userInfoHolder.getUser().getUserId());

    updateItems(appId, env, clusterName, namespaceName, changeSets);

    String formatStr = String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName);
    Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE_BY_TEXT, formatStr);
    Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE, formatStr);
  }