package com.sagacloud.endpointService;

import com.alibaba.fastjson.JSONArray;
import com.sagacloud.utils.ObjectUtil;
import com.sagacloud.utils.PropertyUtil;

import java.util.ArrayList;

public class VirtualObjectService {
    public static void batchDeleteVirtualObj(String pjId, JSONArray criterias, JSONArray errors) throws Exception {
        if(criterias.size() == 0){
            return;
        }
        ArrayList<String> disableObjs = new ArrayList<>();
        ArrayList<String> deleteObjs = new ArrayList<>();
        PropertyUtil.deleteObjects(pjId, criterias, errors, disableObjs, deleteObjs);
        ObjectUtil.deleteAllRelation(pjId, deleteObjs);
    }
}
