import request from "@/utils/request";

// 查询素材库未关联列表  /interactionVideo/noRelation/list
export function getLibraryList(params) {
  return request({
    url: "/business/library/list",
    method: "get",
    params,
  });
}
// 查询素材库未关联列表  /interactionVideo/noRelation/list
export function getnoRelationList(params) {
  return request({
    url: "/interactionVideo/noRelation/list",
    method: "get",
    params,
  });
}
// 查询素材库已关联列表
export function getReleateList(interactionId) {
  return request({
    url: `/interactionVideo/detail/materialInfo/${interactionId}`,
    method: "get",
  });
}
// 素材详情
export function getLibraryDetail(materialId) {
  return request({
    url: `/business/library/${materialId}`,
    method: "get",
  });
}
// 新增素材
export function libraryAdd(data) {
  return request({
    url: "/business/library",
    method: "post",
    data,
  });
}
// 编辑素材
export function libraryUpdate(data) {
  return request({
    url: "/business/library",
    method: "put",
    data,
  });
}
// 删除素材
export function libraryDelete(materialIds) {
  return request({
    url: `/business/library/${materialIds}`,
    method: "delete",
  });
}
// 删除素材关联  /interactionVideo/deleteRelation/{interactionId}/{materialId}
export function releateDelete(interactionId, materialId) {
  return request({
    url: `/interactionVideo/deleteRelation/${interactionId}/${materialId}`,
    method: "delete",
  });
}
