package com.ruoyi.common.utils;


import com.fasterxml.jackson.databind.JsonNode;


import java.util.*;

public class jsonUtil {
    public static boolean checkForDuplicateFields(JsonNode jsonArray, String fieldName) {
        Set<JsonNode> fieldValues = new HashSet<>();

        for (JsonNode obj : jsonArray) {
            JsonNode value = obj.get(fieldName);
            if (value != null && !fieldValues.add(value)) {
                return true;
            }
        }
        return false;
    }
}
