def METHOD_NAME(request):
    """
    给某业务添加一批基于业务的插件
    body: data
    {
        "project_id(optional)": "项目 ID",
        "project_ids(optional)": "项目 ID 列表(list)",
        "component_codes(required)": "插件code列表(list)"
    }
    """
    project_ids = []
    if "project_id" in request.data:
        project_ids.append(request.data["project_id"])
    if "project_ids" in request.data:
        project_ids.extend(request.data["project_ids"])
    component_codes = request.data.get("component_codes")
    existing_unique_keys = {
        f"{component.project_id}-{component.component_code}"
        for component in ProjectBasedComponent.objects.filter(
            project_id__in=project_ids, component_code__in=component_codes
        )
    }
    components = [
        ProjectBasedComponent(project_id=str(project_id), component_code=component_code)
        for project_id, component_code in product(set(project_ids), set(component_codes))
        if f"{project_id}-{component_code}" not in existing_unique_keys
    ]
    create_results = ProjectBasedComponent.objects.bulk_create(components)
    return JsonResponse({"result": True, "data": create_results, "message": ""})